Skip to main content

Full text of "TPUG Issue 07"

See other formats


Commodore Computers' Largest Users Group s Magazine 





October 1984 



$2.95 



Th£ssh3 



\ Commodore 64 
I VIC 20 
[ PET/CBM 
SuperPET 



Automating 
Home Comfort 

The Beginner and 
the Disk. Part IV 



Accurate time on the C-64 

User Port programming and 
hardware 



n6nojoqjeos 

OCfrZI-3 

assep ssep 

9iuaisiai) pjiqi 

ajquiouuB >||hg 



s»isod epeueo 



• ^ %- » 



1 P 



* * 

H 



Laser Art and Technology 



56698V21 



Introducing the Batteries Included 
FAMILY of A*. 

Computer Products 



sr^fifc. 



RpeiCIip 



PaperClip "*^S* 

The fines I word processor 

available for the Commodore 6 1 

now oflers the ability lo switch 

from a 40 to an 80 column display without 

additional hardware. PaperClip' s state of the art design 

allows free movement of columns* phrases, sentences or 

paragraphs from one location to another within the text 

This outstanding addition lo yourCumniodoretvi system is 

now available with Spell Pack. 



Home Organizer Series 

These programs which are available individually, are 
Specifically designed modules fur your record keeping 
activities. Programs available Include stamps, recipes, 
addresses, mailingiisls. personal 4 banking, music and book 
libraries photo and home movie collection and household 
inventory. Each module is so easy to use even a novice can 
achieve professional results. 

The Consultant 

The Consultant, a database management system, is like a 
computerised filing cabinet with a brain. With it you can 
design a layout for any kind of information that needs 
filing, allowing you various methods fur searching, 
sorting and analyzing your data quickly. 



BusCard II 

An improved version of the 

original BusCard which allows you 

t o add a n y C « > m m o do re- c o m p a t i b I e disk 

dri\e, including hard disk, and virtually any printer 

on the market. Just plug it in and you can mix and match 

your peripherals without fear of software incompat ability. 

B.L-SO 
Another plug in module that provides an 80 column* crystal 
clear display. Interference is eliminated even with a full 
screen of characters, It is readily switched from -10 to 80 
column display at anytime and can be used with 
Commodore 1701 and 1702 color monitor or any 

monochrome video monitors. 

Spell Pack 

This program contains a dictionary of over 20.000 
commonly used words in the English language. Spell Pak 
will check each word, in its context, on the entire document 
in 2-1 minutes and highlight those not found in the 
dictionary. You may I hen correct thespeUing if required or 
instantly add the word to the Spell Pack dictionary wilh a 
single key command. In this manner the dictionan ina> 
be expanded by over 5,000 terms for any technical 
or scientific vocabulary vour work mav demand. 



*T<* 



INCLUDED 



'Excellence in Software" 



AW 1ZT |4!61 &9S'14£lb.33CI3 Harhur B*d. CcslJ Mesa CA 92636 (7141 979-0920 



.— u 




520 Fellowship Road, Suite B206; Mount Laurel, NJ 08054 (609) 866-1001 



- 



^ ^ ^ ^ ^ V ^ 



& & 6 *>' 



F # # # <*" # 



¥'■&■* 










The complete information control 
system fbfthe Commodore 64^ 



^ - & £■ 



? * v v" <<? # ^ 



The World Famous Commodore 64. 



No matter what your business 
or interest with Superbase 64 
you have a totally flexible 
1 record h system, as big as you 
want it, as fast as you need it. 



m W * *■? J** 




Create your own 
formats, enter your records, 
change layouts and datafields. 

Superbase gives you 
unrivalled control in home or J 
office, business or 
professional practice, with 
a range of features 
including: 



A45* s 58£ 



3^%4 



1 Precision Software (USA), Inc. 
Suite 1100 
820 Second Avenue 

SfiSSS NY 10017 
OOl IWiin. (2 , 2 , 4go-i 825 




Contents 



Laser Projections — A Meeting Of Art 
And Technology 

Greg Lowry 

"Cover story. Technological art, using lasers, 
electronics and computers." 
Machine — * 
Level — G 
on page 14 



TPUG COMAL Course -Part III 

Borge Christensen 

"How to create branches in COMAL." 
Machine — C/P 
Level — I 
on page 35 






C-64 Thermostat 

John Vanderkooy 

"Using a home computer to automate home 

comfort." 

Machine -C/V 

Level - 1 

on page 55 



Bennett's Tutorial — Relative Files 

Chris Bennett 

"Random-access disk files explained" 
Machine — A 
Level — I 
on page 19 



The Beginner And The Disk — Part IV 

David A. Hook 



Integral Adventure Game 

Brad Bjorndahl 

"Exploring number theory with the aid of 
a computer." 
Machine — A 
Level - 1 
on page 39 

SuperPET 6809 Assembler — Part IV 

Brad Bjorndahl 



The New SYS 

Robert Rockefeller 

"How to make full use of the Commodore 
64's improved SYS command." 
Machine — C 
Level — A 
on page 59 





"How to scratch disk files and validate 
(collect) disks." 
Machine — A 
Level -B 
on page 22 


"Machine language for the 6809 processor." 
Machine — S 
Level — A 
on page 41 


.Departments 






Books 

— Commodore 64 Color Graphics 
John Moore 

— Defending The Galaxy 
Lorien Gabel 

Calendar of TPUG Events 

Editorial 

Games 

— Wizard 
Malcolm O'Brien 

— Trivia 
George Shiiinian 

— Creative Creator 
Rich Westerman 

— Kids On Keys 
Rich Westerman 

Ham Operators 

Help! 

Product Parade 

This And That 

Doris Bradley 

TPUG Associate Club 
Chapter Meetings 

TPUG BBS Password 

TPUG Contacts 


62 




The Commodore B-128 Computer 

Jim Butterfield 

"A description of a little-known computer." 
Machine — * 
Level — G 
on page 26 


Using The User Port — Part I 

David Williams 

"How to program your computer's user 

port." 

Machine — A 

Level — G 

on page 45 


11 

5 
60 


\ 

\ 

1 


C-64 M/L Development System 

/. Allan Farquharson 

"A Product Review." 
Machine — C 
Level — A 

on page 28 


Forecasting With The 8032 — Part IV 

John Shepherd 

"The use of moving averages in forecasting." 
Machine — P 
Level — I 
on page 50 


10 

8 
64 
17 

12 


" 


Menu Handling — Part II 

John Easton 

"Some useful BASIC routines for user- 
friendly programs." 
Machine — A 
Level -I 
on page 31 


Accurate C-64 Timekeeping 

Glen C. Bodie 

"Keeping accurate time in C-64 programs." 
Machine — C 
Level — I 
on page 51 




A = all, C=C-64, V=VIC 20, P=PET/CBM, S=SuperPET, * = none 
G— General, B=Beginner, I = Intermediate, A=Advanced 


20 

4 








TPUG magazine page 3 



TPUG 



magazme 



Publisher 
Chris Bennett 

Editor 

David Williams 

Assistant Editor Production Manager 
Sandra Waugh 

Director of Advertising Sales 
Louise Redgers 
(416) 782-9804 

Production Team 
Astrid Kumas 
Marya Miller 
Monica Bodirsky 

Graphic Design 

Leslie Smart and Associates, Toronto, Ont. 

Printing 

Delta Web Graphics, Scarborough, Ont. 

Cover Photo 

Roberto Portolese Studio, Toronto, Ont. 

TPUG Magazine is published 10 times a year by TPUG, Inc. All 
rights reserved. No material may be reprinted without written 
permission. 

TPUG yearly membership fees: 

Regular member (attends meetings) —$30.00 Cdn. 

Student member {full-time, attends meetings) — $20.00 Cdn. 
Associate (Canada) -$20.00 Cdn. 

Associate (U.S.) -$20.00 U.S. 

-$25.00 Cdn. 
Associate (Overseas — sea mail) —$30.00 U.S. 

Associate (Overseas — air mail) —$40.00 U.S. 

TPUG Inc., 

1912-A Avenue RcLSte. #1 
Toronto, Ont. 
M5M 4A1 

Telephone numbers: 
Business Office (416) 782-8900 
(416)782-9252 
Magazine Office (416)782-1861 
Advertising (416)782-9804 

VIC 20^ Commodore 64 and SuperPET are trademarks of Commo- 
dore Electronics Ltd. PET is a registered trademark of Commodore 
Business Machines, Inc. CBM is a registered trademark of Commo- 
dore Electronics Ltd. 

TPUG Magazine is printed in Canada. Mailed at Toronto, ON and 
Buffalo, NY. Send change of address to: TPUG Inc., Address Changes, 
1912-A Avenue Rd., Toronto, ON, Canada M5M 4A1 

Subscription: 15,500 
Newsstand: 10,000 
ISSN #0825-0367 



Distributed bv: 

Compulit Distributors 

PO Box 352 

Port Coquitlam, BC 

V3C 4K6 

(604)464-1221 



Micron Distributing 
409 Queen Street W. 
Toronto, ON 

M5V 2A5 

(416)593-9862 

Toll Free Order Desk 

1-800-268-9052 



Subscription-related inquiries 
are handled ONLY by TPUG. 



TPUG CONTACTS 





TPUG OFFICE 






(416)782-8900 






(416) 782-9252 




Board of Directors 






President 


Michael Bonnycast 


le 416/654-2381 


Vice-President 


Chris Bennett 


416/782-9252 


Vice-President 


Gord Campbell 


416/492-9518 


Treasurer 


Carol Shevlin 


c/o 416/782-8900 


Recording Sec. 


John Shepherd 


416/244-1487 


Directors 


Bruce Beach 


519/925-5376 




Rosemary Beasley 


416/787-8432 




Gary Croft 


416/727-8795 




Mike Donegan 


416/639-0329 




John Easton 


416/251-1511 




Gerry Gold 


416/225-8760 




Louise Redgers 


416/447-4811 


TPUG Inc. 






Business Mgr. 


Chris Bennett 


416/782-8900 


Asst. Business Mgr 


Doris Bradley 


416/782-8900 


TPUG Magazine 






Publisher 


Chris Bennett 


416/782-1861 


Editor 


David Williams 


416/782-1861 


Asst. Editor/Prod. 1 


VIgr. Sandra Waugh 


416/782-1861 


Ad Director 


Louise Redgers 


416/782-9804 


Meeting Co-ordinators 




Brampton Chapter 


Garry Ledez 


c/o 416/782-8900 


Central Chapter 


Michael Bonnycast 


e 416/654-2381 


C-64 Chapter 


Louise Redgers 


416/447-4811 


Comal Chapter 


Donald Dalley 


416/742-3790 




Victor Gough 


416/677-8840 


Communications 


David Bradley 


416/782-8900 




Richard Bradley 


416/488-4776 


Eastside Chapter 


Kelly Grinton 


416/839-7284 




Joyce Topley 


416/683-4898 


Forth Chapter 


David Williams 


416/782-1861 


Hardware Chapter 


David Williams 


416/782-1861 


Machine Language 


Jim Carswell 


416/531-9909 


SuperPET Chapter 


Gerry Gold 


416/225-8760 


VIC 20 Chapter 


(Doris Bradley) 


416/782-8900 


Westside Chapter 


John Easton 


416/251-1511 




Al Farquharson 


519/442-7000 


Librarians 






Commodore 64 


David Bradley 


416/782-8900 




Richard Bradley 


416/488-4776 


French 


Baudouin St-Cyr 


c/o 416/782-8900 


PET 


Mike Donegan 


416/639-0329 


SuperPET 


Bill Dutfield 


416/224-0642 


VIC 20 


Chris Covell 


416/925-9296 


Bulletin Board 


Richard Bradley 


c/o 416/782-8900 


Conference 


Doris Bradley 


416/782-8900 



page 4 TPUG magazine 



editorial 



I feel it is sad that there are now so many 
people who have been born too late to have 
experienced the 1960's. Havingspent their 
entire sentient lives within the last fifteen 
years or so, most of them must see the world 
as a far more drab and boring" place than do 
we whose memories go back to that magical 
decade. 

As a science student whose friends included 
many energetic and artistically creative 
people, I spent much of the '60°s blithely 
ignoring the supposed cultural division 
between the arts and sciences. In doing so, 
I was far from alone. Every Friday night, 
some of us would gather in a basement in 
London, England, to entertain each other 
in every way we could, including with a lot 
of intriguing technological devices. We 
called ourselves and our venue "The UFO 
Club 1 '. Among us were some experimental 
rock musicians who were trying out new 
electronic techniques of music-making. They 
were quite successful. As the "Pink Floyd", 
they later achieved world-wide fame. Oth- 
ers of us, including myself, were more inter- 
ested in kinetic visual effects. Armed, 
mainly, with modified slide projectors in 
which the slide-holders had been replaced 
with various means of producing moving- 
coloured patterns, we decorated the walls 
of the club with brilliant, swirling, bubbling, 
writhing shapes. As the Floyd played, we 
endeavoured to provide appropriate visual 



accompaniments to their music. Some of 
our light-machines were capable of being 
"played" as para-musical instruments. A 
light-artist would sit with his fingers on a 
set of buttons, pressing them in time with 
the music. In response, the machine would 
vary the projected patterns. 

By the standards of the *80's, of course, our 
efforts were extremely primitive. Nothing 
we did then could come close to matching 
the effects which can be produced today. 
We projected patterns onto walls. The laser- 
artists of 1984 etch their images in stark 
clarity into the fabric of the cosmos. 

The last sentence is, of course, an exaggera- 
tion in a physical sense. But it is totally 
inadequate to describe the sensation of 
watching a laser display projected upon 
the dome of a planetarium. Using equip- 
ment which incorporates an astonishing 
array of differing technologies, a laser-artist 
can transport his audience into a dazzling 
new area of experience. Space itself becomes 
the arena in which luminous coloured 
shapes, some abstract and some realistic, 
some crystal-sharp and others tenuously 
ghostly, float and whirl in synesthetic har- 
mony with the music. 

Since the technology involved in laser art 
■includes the use of such things as micropro- 
cessors and digital memories, it is clearly 
an appropriate topic for this magazine. In 



this issue, you will find an article by Greg 
Lowry, who is the artist responsible for the 
laser displays at the McLaughlin Plane- 
tarium, in Toronto. His art is shown in 
some of our photographs, including those 
on the front cover. Yet, in a static, low- 
contrast medium such as the pages of a 
magazine, it is impossible to convey more 
than a faint shadow of what he actually 
does. For those readers who have attended 
laser shows, his article should illuminate 
some of their technical facets. But for those 
who have not yet seen this art-form, we 
cannot claim that this magazine offers a 
worthwhile substitute. 

Greg's article should also stimulate the 
imagination of readers who want to explore 
new uses for their computers. Although 
none of the Commodore machines with 
which we are all familiar can rival the sophis- 
tication of the equipment which Greg uses, 
they can be used to control external devices, 
including lighting systems. Readers who 
feel up to building some hardware, as well 
as writing programs, should be able to pro- 
duce some very interesting displays of 
synchronized music and light. I know this 
is a field which I, myself, intend to 
explore! TPUG 

David Williams 



< 

< 

Q 



m FIRST 
FAN LETTER. 




TPUG magazine page 5 



sX^ Finn ity El 



For Use With COMMODORE'S VIC-20®* and C-64®* 



******AAA4 



$149.00 



FIDELITY ELECTRONICS 
presents the 




user selectable column width: 
24, 32 or 40 column printout 

No additional hardware needed. Connects directly to 
VIC-20®* and C-64.®* The "IMPACT PRINTER" "uses 
standard adding machine paper roll available most 
anywhere. 

USES: Program listings, screen copy, reports, mailing 
lists, graphics etc. 

FEATURiES: Cartridge ribbon, uses standard 2.25" wide 
plain paper roll , 24, 32 or 40 column width capability, 
upper/lower case characters, graphic character set, 
double height printing, and one user denned 6x8 dot 
matrix character. 

Copyright by Fidelity Electronics. Ltd. 

*VIC-20 K and C-64' are trademarks of 
Commodore Business Machines, Inc. 




FIDELITY ELECTRONICS, LTD. 

5682 AMBLER DR., MISSISSAUGA, ONTARIO L4W 2K9 
(416)625-7333 



PLEASE PRINT 
NAME 



.PHONE NO- 



FULL ADDRESS. 



□ CHEQUE OR MONEY ORDER FOR $_ 

□ MASTER CHARGE OR VISA NO 



ONTARIO RESIDENTS 
_ PLEASE ADD 7% SALES TAX 

EXPIRY DATE 
-DATE 



PRO TERM 64 

INTELLIGENT TERMINAL PACKAGE 

(C) 1984 E. ANDERSON AND G. FARMANER 



40/80 column display 

Informative status line 

Extensive Auto- Dial/ Auto-logon commands 

Upload/Download : 
(Punter) (X/ON X/OFF) (.IMG FILES) 

Ram Buffer options 

Complete Disk support, DOS commands, 
dual drive, or two single drives 

Complete Printer support 

Transparent stream to Printer 

Programmable Function Keys 

Remote-terminal modes, (Mini BBS), 
(Visual phone answer) 

Supports VT/52 and Televideo 910/920 
terminal emulations 



ABACUS BOOKS 

THE ANATOMY OF THE 1541 DRIVE 
THE ANATOMY OF THE 6 4 
MACHINE LANGUAGE BOOK OF THE 64 
TRICKS AND TIPS ON THE 6 4 

$24.95 each 



Write for our FREE catalog. 




disk $46.95 



Suite 210. 5950 C6te des Nelges, Montreal, Quebec H3S 1Z6 

Money Order, Check, Dealer and distributor inquiries invited. 



page 6 TPUG magazine 



THIS & THAT 



Doris Bradley 

Assistant Business Manager 

MARCA Conference 

July 28th and 29th found me in Hershey, 
Pennsylvania, attending the First Annual 
Commodore Users' Conference and Com- 
puter Show of the Mid-Atlantic Regional 
Commodore Association. Hats off to the 
co-ordinating committee which put together 
this successful combination of speakers and 
dealer display. Congratulations especially 
to Mindy Skelton, who handled registration. 
As the one who co-ordinated registration 
for TPUG's Third Annual Conference this 
May, I can fully appreciate all the work 
that she did in preparation for July 28th. I 
must say I enjoyed being a participant rather 
than an organizer. I attended a great many 
sessions including Pre-Beginner Machine 
Language with Lou Sander, Better BASIC 
with Jim Butterfield and Women in Com- 
puting with Ellen Strasma. 

I now realize how spoiled we are here in 
Toronto. Just about any month a Regular 
or Student member can hear Jim Butterfield 
expound as only Jim Butterfield can. I had 
to attend his session in Hershey to fully 
appreciate how much others appreciate him 
and just how lucky we are! 

I expect my Hershey experience will be 
useful to me as co-ordinator of TPUG's 
Fourth Annual Conference next May. 

Another Riddle 

What does a person who does word process- 
ing like to drink? 

TPUG Bulletin Board 

By the time you read this, the Bulletin 
Board will have moved again. The new 
number is 416-782-9534. Hopefully, this is 
the last move for a while! 

VIC Programming Contest 

I trust that your entry to the VIC program- 
ming contest is in ! The deadline is October 
2, 1984. The two sections to the contest are 
( 1 ) programs written in BASIC and (2) pro- 
grams written in another language. 

Tape Terminal Programs 

Gord Campbell has put together a set of 
terminal programs which will work on tape. 
As yet, this "group" has not been properly 
organized for the library and therefore does 
not have an official library name. However, 
if you wish to purchase this tape in its pres- 
ent form (cost $6.00), just ask for the "tape 
terminal programs". 



Associate Club Chapters 

The list of groups who have taken advan- 
tage of the offer to have fifteen or more of 
their members join TPUG at a saving of 
$5.00 per member is growing all the time. 
The latest additions are: Southern Califor- 
nia 64 Users Group, Eagle Rock Commo- 
dore Computer Club of Idaho Falls, Idaho; 
Phoenix Arizona Commodore Club; Mid- 
City Commodore Club of Fort Worth/ 
Arlington Texas; Mountain Computer 
Society, Utah; and Anchorage Commodore 
Users Group, Alaska. We now have fifty- 
one associated clubs! 

TPUG Conference 1984 

Have you sent in the Appraisal Sheet which 
was on page 58 of the August/September 
TPUG Magazine? No? — please take a few 
minutes and do it today. Meetings to plan 
the next Conference are already under way. 

Coming Events 

A Machine Language course taught by 
David Williams (Editor of TPUG Maga- 
zine) will be offered in the Toronto area. 10 
classes from 5:00 to 7:00 pm. on Tuesday 
evenings, starting October 2nd. Location 
— Lakeshore Collegiate (Kipling Avenue, 
near Lakeshore). For further information 
call The Continuing Education Department, 
Etobicoke Board of Education (626-4360) 
and ask about course # 1815. Total course 
cost -$20.00. 

Storywriter for the C-64 

Stop the presses! Don Whitewood of the 
Toronto Board of Education has succeeded 
in getting version 11 of Storywriter for the 
PET converted to the Commodore 64. Know- 
ing Don, this is THE version to have. There 
are a few other versions out and about, but 
unfortunately they are based on earlier ver- 
sions of the PET program. At the time of 
writing, I do not know which C-64 disk 
Storywriter will appear on. If you can't 
wait for next month's magazine before 
ordering, just send in an order for "the 
disk with Storywriter for the 64", and we'll 
do the rest. 

NOS Translator 

In the July issue it was stated that the NOS 
Translator programs had been given to the 
TPUG Librarians for inclusion in the club 
library. I have asked that these programs 
appear on the September releases for the 
VIC 20, PET and C-64. 



Tape Mastering 

TPUG has purchased a Sony high-speed 
tape duplicator to copy Commodore Edu- 
cational tapes, plus any future C-64 and 
VIC tapes. The arrival of this machine will 
speed up our ability to make these tapes 
available to members. Gone forever are 
the long waits for tapes! 

At long last we are having success with our 
disk-to-tape program and intend to pro- 
duce any PET tapes that are ordered by 
this method. 

Tape Drives 

Chris Bennett has spent many hours testing 
the alignment of datasettes. We recently 
purchased two brand new datasettes from a 
CBM dealer — one was okay, the second 
was way out of alignment; — some programs 
would load, others would not. By perse- 
vering, Chris has mastered aligning a tape 
drive without sending it to Commodore 
— and without using an oscilloscope. He is 
now working on developing a tape align- 
ment kit for about $5.00. If he can get the 
special screwdriver he needs, it may be 
free with an order of four tapes. More news 
on this later. . . 

Annual General Business Meeting 

As mentioned in the Calendar of TPUG 
Events, the Annual General Business Meet- 
ing will take place on Thursday, October 4 
at Leaside High School, Bayview fe Eglinton 
Avcs., Toronto, at 7:30 p.m. I am taking 
the space to repeat the information again 
here because it is important that 'Regular' 
Members in particular take note, mark the 
date on their calendars and make a point of 
coming out and participating. The finan- 
cial statement for the fiscal year will be 
discussed, the executive for the next year 
will be elected, etc. 

The vitality of any democratically-organized 
group can be measured by the active involve- 
ment of its members. Just as it is your right 
(and I would say, your duty) to take an 
informed part in a political election, so it is 
your right (and I would say, your duty) to 
take an active interest in your club. If you 
can't come in person, read over the "Notice 
Of Meeting" package which Regular mem- 
bers will receive in the mail, and make sure 
that your views are being represented by 
using your proxy form. 

Answer 

A word processor drinks TAB. TPUG 



TPUG magazine page 7 



HELP ! 



Do you have anything for this column? The three headings are: 

(1) Helpful Hints, 

(2) Who's Got the Answer? and 

(3) "PET" Pals Wanted. 

Just send your contributions (including answers to any questions which 
have appeared) to: 

Toronto PET Users Group 
Dept. Help 

1912A Avenue Rd., Ste. 1 
Toronto, Ontario, Canada 

M5M4A1 

Please let us know if you wish your full address published. 

S.O.S. from Doris Bradley: If you follow the HELP column regularly you 
will be aware that there are many people out there with questions. On the 
other side of the coin, we do have some very knowledgeable and helpful 
members who pitch in and provide information, technical help etc. Just 
recently Clayton W. Dewey K8CKD volunteered to answer questions 
from HAM operators. His offer got me thinking about one of the biggest 
problems I have — where to find someone who can answer a specific 
question. What I'd like to do is to set up a Manager file of those members 
who could be called upon occasionally to provide some assistance 
(indicating their area(s) of expertise). If you might consider volunteering. 
drop me a line or give me a call and let's discuss it. I would only provide 
you with one inquiry a month (unless you indicated otherwise). 



Helpful Hints 

This month the Hints section takes on a 
new look. Below you will find questions 
along* with answers which have been pro- 
vided by some of our experts in the Toronto 
area. As much as possible, we will try to 
deal in this way with some of the more 
interesting questions which probably have 
wide appeal. 

(Q) I would like to address a problem that 
we have encountered and I'm sure other 
members have also come across. When you 
acquire new programs in the Commodore 
Educational Series, you incorporate them 
in alphabetical order. This causes the mem- 
ber who previously owned all the programs 
to do without, or order a whole new set. I 
understand that this is the easiest and most 
organized way to list these sets. If I may be 
so bold as to suggest also incorporating 
new diskettes consisting of these newly 
released programs: i.e. "ED ADDENDUM 
#T\ so that the member can keep a full set 
without too much trouble and expense. 

William F. Besterman 
Nautilus Computer Club 
Groton, CT 06340 

(A) / understand fully the problem you are 
faced with, but unfortunately TPUG is not 
the originator of this series, and so does not 



have the opportunity to incorporate the pro- 
grams as we would wish. If we had the time, 
we would like to take the Commodore Educa- 
tional Software library and reorganize it accord- 
ing to grade level As a matter of fact, if David 
Bradley, one of the Commodore 64 librarians, 
succeeds in reorganizing all the current 
monthly disks for the C-64 into category disks 
before the summer is over, he intends to do 
just that. In addition, if you were to supply a 
list of the newly released programs, he might 
also be able to do as you suggest. 

(Q) It would be greatly appreciated if you 
can explain how I can include your Lockdisk 
64 program (or something equal) to my 
disks, since it is in ML and I don't have a 
working knowledge of it at this time, and 
am still confused tremendously even though 
I have the (C)E1 disk. Any help you can 
provide in clearing the snow of ML pro- 
graming would be greatly appreciated. 

Also in your copy programs: File Copy 
and Copy All have SYS #'s in them which 
prevent making comments in the program 
or otherwise modifying them. Could you 
explain why, for what purpose and how 
they could be implemented in any pro- 
grams I write. 

I appreciate your efforts in writing all these 
various programs and would hope that you 
would start a series on programing, mainly 
in the area of how to use the various rou- 



tines that are currently imbedded in the 
C-64 for assisting in writing programs for 
us newer-type people who have only had a 
year or so with computers. 

Another request I have of you is for a Chris- 
tian Brother who teaches computers at St. 
Joseph H.S. here in Westchester. His request 
is for a PRINT USING command which he 
got used to on an Apple. The high school at 
present has 12 C-64's and 4 1541 drives 

James M. Ardovitch 
Chicago, Illinois 

(A) Lockdisk 64 is a BASIC program which 
has locked itself It can be copied by using 
any readily available copy program such as 
1541 Backup or Unicopy. 

The SYS #s call up Machine Language parts 
of the program. The Machine Language is 
used for speed. You will need a Machine 
Language monitor to list this, plus a little 
knowledge. 

There is a brief PRINT USING program in 
the library which will format numbers neatly 
for output in columns. 

(Asst. Business Mgr. 's Note: Jim Butterfield 
has a book on Machine Language program- 
ming which was just recently published. It is 
called "An Introduction to Commodore 
Machine Language Programming" and is 
published by Robert J. Brady Co.) 



(Q) I am the "Computer Lady' 1 here at the 
Dubin Center. We own and use 2 Commo- 
dore PETs, 1 CBM 8032, and 1 Commo- 
dore 64. 

Quite often we have had the situation where 
there are some programs on the 1541 disk 
format that we wish to have also on our 
PETs or CBM. I have tried many times to 
save these programs onto tape, but these 
tapes will not run or list on either the PETs 
or the CBM. 

Can you help me? What will make these 
programs run and list on the other ma- 
chines? 

Heather Albright 

Santa Barbara, California 

(A) To make the programs loadable on the 
PET, you must make the C-64 pretend tem- 
porarily that it is a PET too. The following 
POKEs on the C-64 will do it: 

POKE 56576,5:POKE 53272,4:POKE 648,128: 
POKE 1024,0:POKE 44,4:POKE 56,128:NEW 

These should all be given in one line. The 
resulting screen will be messy so clear the 
screen. Now load the programs that you wish 



page 8 TPUG magazine 



to transfer one last time, save on afresh tape 
or disk and these newly saved programs will 
load correctly into the PET. WARNING! If 
the program uses special features of the 64 
such as colour or sound, this procedure will 
get it to load but you still will not be able to 
run it. 

(Q) I am trying to obtain a utility that will 
do the following: To make a M/L Code 
program on a HIRES or NORMAL screen, 
step one instruction at a time, so at any 
point I can read the instruction last executed, 
its location in memory, and the A X Y 
registers. 

Ideally, the utility should reside from $C000 
upwards and be able to read programs up 
to $BFFF after lifting the ROM at SA0O0. 

I have been told that your EXTRAMON 
may be able to do this but I cannot get any 
information on it. If you know of a pro- 
gram that will do what I require would you 
let me know where I can obtain it with 
instructions (1541 disk if possible). 

Roger K. Walsome 
Feltham, England 

(A) Supermon 64 is available, but it does not 
contain a single step version. For debugging 
I would recommend inserting the break 
command. The source programs for Supermon 
have been given to the Commodore 64 
librarians, but I am not sure if they have 
appeared in the library yet. 

(Q) Apparently Commodore U.K. are about 
to release a Z80 cartridge together with 
CP/M. Is this available in Canada yet? 

I am very interested in Logo. By that I 
mean a full use/implementation, not just 
Turtle Graphics. "The surface of Logo has 
yet to be scratched — my theory!" 

Alistair O'Connell 
Cornwall, England 

( A) As far as CP/M is concerned, yes; there is 
a limited CP/M available. It is "limited" since, 
first of all, the C-64 has only 40 columns, 
while most CP/M programs expect more. 
Secondly, the version we have seen operates 
in 48K of memory and many CP/M pro- 
grams expect 56K. Finally, Commodore disks 
have a different format than most CP M 
disks. It seems likely that the Commodore 
version is a training CP M rather than a 
fully-fledged system. 

Commodore Logo is first-class. It is written 
by Terrapin and may be the most full-featured 
Logo ever placed on a micro. 



Questions 

I have a PET 2001 with a graphic ROM, 
and a Gemini printer with an ADA 1800 
interface. Is there a commercial or public 
domain program for downloading the PET 
graphic set to the printer? I know there is 
one by Cardco for the C-64, but what about 
the 2001? 

Candy Jens 
Wall, New Jersey 

As a high school teacher, I have been con- 
sidering some independent micro tutoring. 
The '84 educational activities-computer pro- 
grams brochure from 'Educational Activities, 
Inc.' shows promise. True/False? 

Ray Hendle 
Innisfail, Australia 

I have tried many places to find out how I 
can make my CBM display the characters 
necessary for foreign languages. (I am using 
a TEC 1500 Starwriter Printer.) This in- 
cludes writing to many of the Commodore 
Computer Stores in French-speaking Can- 
ada and writing to those addresses in 
Commodore's Encyclopedia advertising the 
equipment necessary for this ability. In 
desperation, I asked my local computer 
store to help me, but alas, it all seems in 
vain. Has anyone got any helpful sugges- 
tions? 

Clinton S. Cummings 
40011 McDowell Cr. Dr. 
Lebanon, Oregon 99355 

Is there a word processor for use with French 
text which will work with a C-64, 1541 disk 
drive, 1702 monitor and Gemini-lOX prin- 
ter? 

Warren Pollans 

South Carolina State College 

Orangeburg, SC 29117 

I am looking for programs for our 4032/4040 
system which would give us general ledger 
capabilities; data-base management; Bible 
research. I know that a lot of programs of 
these types are available for CP/M. Is it 
worth while, in light of Ron Kushnier's 
article, to buy a Z-RAM so that we could 
use these CP/M programs? 

Rev. J. Paul Morris 
Long Beach, CA 

Is there anyone who has successfully modi- 
fied the Macrotronics M650 RTTY + ASCII 
terminal program for 4.0 BASIC on the 
8032 (not 4032)? 

P. J. Rovero 
Monterey, CA 



I have a Commodore 64 and a 1650 Auto- 
modem. I have been using 'Autoterm/1650.c 
and Term64.d' to access CompuServe, DJNS, 
etc. Ian Wright, in his review of the C-64 
Automodem, seemed to have no trouble 
using this terminal software. However, I 
cannot figure out how to download data 
from these sources. My main interest is to 
download text from their encyclopaedia, 
news reports, etc. I have been logging on 
via DATAPAC in Winnipeg. If this soft- 
ware is not adequate could someone sug- 
gest a suitable one? I should add I have a 
1541 disk drive but do not have a datasette. 
The program that came with the modem is 
on cassette and I can't use it. 

Dr. S. A. Randeree 
Emerson, Manitoba 

I teach physics, mathematics and some elec- 
tronics at university- After considerable eval- 
uation of equipment and software I have 
purchased and am presently using the C-64, 
DATA 20 Eighty column plug-in and Gem- 
ini 10 printer for word processing. The 
word processor is from Protecto. In the 
sciences one often needs to type superscripts 
and subscripts, greek symbols, and mathe- 
matical symbols. Of course, descenders are 
also necessary for appearances sake. It would 
also be nice to be able to compose the work 
on the screen in 80 columns and print in 
exactly the same format. Does someone know 
of a system that will do all of this for a 
reasonable price? 

Robert Speers 
Huron, Ohio 

I am a science/maths teacher at the local 
high school. Although I am using micros 
for introducing BASIC only at the moment, 
it is my intention to develop its business 
capacities (a 'course' available for the com- 
munity), its micro tutoring (generally for 
younger people), and specific programming 
courses such as LOGO. I am also in the 
process of evaluating Multiplan, The 
Manager, and SuperBase 64 as business 
tools. No doubt there are members who 
have progressed beyond the early stage 
which I mention here. Perhaps I could 
receive some much needed assistance by 
referral to texts, software, ideas. . . 

R. J. Hendle 
P.O. Box 1072 
Innisfail, 4860 
Queensland, Australia 



continued overleaf 



TPUG magazine page 9 



I am trying to locate "Hairdressing School" 
as listed in the Commodore Encyclopedia 
of Software. Can anybody help? 

Robert Everett 
155 Castlefield Ave. 
Toronto, ON M4R 1G6 



I have a VIC 20 and a VIC-1525 printer. 
My printer always writes over the previous 
line. How can I fix it? Also, I need some 
help with telecomputing. I use the Vic- 
modem, with Victerm 1. 

Liesel Radke 

Box 1382 

Rocky Mtn House, AB TOM 1T0 



PET Pals 



I would like to communicate with someone 
or some group with similar equipment to 
mine. I have an 8032 with an 8050 dual disk 
drive, and a Madison Z-RAM board with a 
Z-80A microprocessor, and a copy of CP/M 
version 2,2. 

Stanley K. Johns 

60 Guilford Lane, Ste. B 

Williamsville, NY 14221 



I am interested in trading ideas and the 
like with anyone who currently lives in a 
foreign country. A requirement is that you 
either speak English or Chinese as these 
are the only two languages I know. 

Patrick Grote 

1 1706 Devonshire Ave. 

St. Louis, Missouri 63131 

I am French-speaking and living in Aus- 
tralia. I would like to be in contact with any 
French-speaking Commodore 64 users. 

Guy Coppens 

Australian Computer Education Ass'n 

P.O. Box 194 

Corinda 4075, Australia 



HAM OPERATORS 



Name 


Location 


Call Sign 


Canada 






R.E. Pettit 


Brandon, MB 


VE40P 


R.M. Johnston 


Rothesay, NB 


VE1EY 


Michael R. Henwood 


Moncton, NB 


VE1BXV 


William S. Townson 


Ottawa, ON 


VE3KIF 


Maria G. Townson 


Ottawa, ON 


VE3KIP 


Harold A. Dietrich 


Waterloo, ON 


VE3EJP 


Rick Whitcomb 


Verona, ON 


VE3NWT 


Ron Hall 


Lakefield, ON 


VE3CRT 


Jack Millage 


Lakefield, ON 


VE3BLL 


Ron Norris 


London, ON 


VE3FXX 


Jack Becker 


Downsview, ON 


VE3NZJ 
or K4PBH 


J. Allan Smith 


Trenton, ON 


VE3GI 


Derek V. Stott 


North Bay, ON 


VE3KAA 


Peter Hayes 


White Spruce, SK 


VE5ACY 


International 






Peter J. Archer 


Nelson, New Zealand 


ZL2TYP 


Juhani Leinonen 


Turku, Finland 


OH1FS 


United States 






Cameron G. Pierce, Jr. 


Palo Alto, CA 


N6TQ 


J. Carter Courtney 


Lyme, CT 


WA1FOK 


Alfred Kornfeld 


Manchester, CT 


KM1U 


Lyman Duggan 


Tampa, FL 


VE3ILW/W4 


John McDowell 


Crest Wood, IL 


N9CVK 


Dick Wasserberg 


Lincolnwood, IL 


K9RRF 


Ronald Maclntyre 


Newbury Port, MA 


KA1LCZ 


Carl A. Kolenda 


Troy, MI 


WB8BTY 


John C. Sutherland 


Livonia, MI 


W8MOB 


R. M. Strieker 


Charleston, MO 


W0UX 


Robert McKinleyJr 


Tington Falls, NJ 


W20MR 


Geoff Krauss 


Latham, NY 


WAZGFP 


K.P. Perry 


Kingsport, TN 


N4DRG 


Robert J. Hennings 


Piano, TX 


N5ECM 


Michael Melum 


Alexandria, VA 


WA0CJI 


Marvin Lowman 


Inwood, WV 


WB8NQB 




JOIN TPTJG 

The largest Commodore Users Group 

Benefit from: 
Access to library ofpublic domain software for G--64, 
VIC 20 and PET/CBM 

Magazine ( 3 per year) with advice from 

Jim Buiter field 

David Hook 

Borge Gtmatensen 



TPUG yearly memberships: 

Regular member (attends meetings) 
Student member (full-time, attends meetings) 
Associate (Canada) 
Associate (U.S.A.) 

Associate (Overseas — sea mail) 
Associate (Overseas — air mail) 



-$30.00 Cdn. 
-$20.00 Cdn. 
-$20.00 Cdn. 
-$20.00 U.S. 
-$25.00 Cdn. 
-$30.00 U.S. 
-$40.00 U.S. 



FOR FURTHER INFORMATION: 
Send $1.00 for an information catalogue 
(tell us which machine you use!) 

To: TPUG INC. 
DEPT.A, 

19 ISA AVENUE HD., SUITE 1, 
TORONTO, ONTARIO 
CANADA M5M4A1 



page 10 TPUG magazine 



CALENDAR OF TPUG EVENTS 



Fall Schedule 



ANNUAL BUSINESS MEETING -Thursday, October 4, at Leaside 
High School, Bayview k Eglinton Aves., at 7:30 p.m. in the 
auditorium. Regular members are voting members. 

Please note: The exceptions to the "rule" for the designated date for a 
meeting (e.g. 2nd Thursday) are shown in bold. 

BRAMPTON CHAPTER - Central Peel Secondary School, 32 Ken- 
nedy Rd. N., on the second Thursday of the month at 7:30 in the 
Theatre. 



Thu. Sept. 13 
Thu. Oct. 18 



Thu. Nov. 8 
Thu. Dec.13 



CENTRAL CHAPTER - Leaside High School, Bayview k Eglinton 
Aves., on the second Wednesday of the month, at 7:30 p.m. in the 
auditorium, for PET/CBM. 



Wed. Sept. 12 
Wed. Oct. 10 



Wed. Nov. 14 
Wed. Dec. 12 



COMAL GROUP -York Public Library, 1745 Eglinton Ave. W., 
(just east of Dufferin) on the last Thursday of the month at 7:30 
p.m. in the auditorium. 



Thu. Sept. 27 
Thu. Oct. 25 



Thu. Nov. 29 
Thu. Dec. 27 



Commodore 64 CHAPTER- York Mills C.I., 490 York Mills Rd., 
(east of Bayview) on the last Monday of the month, at 7 :30 p.m. in 
the cafetorium. 



Mon. Sept. 24 
Mon. Oct. 29 



Mon. Nov. 26 
Mon. Dec. 17 



COMMUNICATIONS GROUP- York Public Library, 1745 Eglinton 
Ave. W., (just east of Dufferin) on the first Wednesday of the 
month, at 7:30 p.m. in the Story Hour Room (adjacent to the 
auditorium). 



Wed. Sept. 5 
Wed. Oct. 3 



Wed. Nov. 7 
Wed. Dec. 5 



EASTSIDE CHAPTER - Dunbarton High School, (from the traf- 
fic lights at Highway 2 and Whites Rd. — go north on Whites Rd. to 
next traffic lights — turn left to parking lots) on the second Monday 
of the month at 7:30 p.m. in Rooms 327 and 329. 



Mon. Sept. 10 
Mon. Oct. 15 



Mon. Nov. 12 
Mon. Dec. 10 



FORTH CHAPTER -York Public Library, 1745 Eglinton Ave. 
W., (just east of Dufferin) on the second Tuesday of the month, at 
7:30 p.m. in the Story Hour Room (adjacent to the auditorium). 

Tue. Sept. 11 Tue. Nov. 13 

Tue. Oct. 9 Tue. Dec. 4 

HARDWARE CHAPTER -York Public Library, 1745 Eglinton 
Ave. W., (just east of Dufferin) on the first Friday of the month, at 
6:30 p.m. in the Story Hour Room (adjacent to the auditorium). 



Fri. Sept. 7 
Fri. Oct. 5 



Fri. Nov. 2 
Fri. Dec. 7 



MACHINE LANGUAGE CHAPTER (6502) - Call Jim Carswell at 
416/531-9909 for additional information. 



SuperPET CHAPTER -York University, Petrie Science Building 
(check in Room 340). Use north door of Petrie to access building. 
On the third Wednesday of the month at 7:30 p.m. 



Wed. Sept.19 
Wed. Oct. 17 



Wed. Nov. 21 
Wed. Dec. 19 



VIC 20 CHAPTER - York Public library, 1745 Eglinton Ave. W., 
(just east of Dufferin) on the first Tuesday of the month, at 7:30 
p.m. in the auditorium. 



Thu. Sept, 6 
Tue. Oct. 2 



Tue. Nov. 6 
Tue. Dec. 4 



WESTSIDE CHAPTER -Clarkson Secondary School, Bromsgrove 
just east of Winston Churchill Blvd., (south of the QEW) on the 
thud Thursday of the month, at 7:30 p.m. in the Little Theatre for 
PET/CBM/VIC 20/Commodore 64. 



Thu. Sept. 20 
Thu. Oct. 18 



Thu. Nov. 15 
Thu. Dec. 20 



Are you interested in organizing some other interest group in the 
Greater Toronto area? Please let the club office know, by mail, 
phone, or TPUG bulletin board. 



Interested in 

COMAL? 



TPUG is pleased to announce a COMAL program- 
ming manual, written by one of the language's creators, 
Borge Christensen. 



This book contains over fifty pages of text and examples. 
It is ideally suited as a language tutorial as well as a 
desk-top reference manual for programmers. 

A special introductory price of $6.95 will be in effect 
until October 31st, 1984. The regular price is $9.95. 



Send your orders 

To: THJGINC. 
DEPT. A, 

19 12A AVENUE RD., SUITE 1, 
TORONTO, ONTARIO 
CANADA M5M 4A1 ^ 



TPUG magazine page 11 



TPUG Associate Club Chapter Meetings 



CANADA 

Edmonton Commodore Users Group 

— meets at Archbishop Jordan His;"h School, Sherwood Park, on 
the last Friday of each month ai 7 p.m. 

Contact Bob Kadylo 403-465-3523 

Guelph Computer Club 

— meets at Co-operators Insurance Assoc, on the 2nd Wednesday 
ol each month at 7:30 p.m. 

Contact Brian Grime 519-822-4992 

London Commodore Users Club 

— meets at Althouse College of Education, main auditorium, on 
the third Monday of each month at 7 p.m. 

Contact Dennis Trankner 519-681-5059 

Sarnia C-64 Users Group 

— meets at Lambton College on the first Sunday of each month at 
7:30 p.m. 

Contact J. C. Hollemans 519-542-4710 

Commodore Users Club of Sudbury 

— meets at Lasalle High School in the cafeteria, on the last Thursday 
of each month at 7 p.m. 

Contact Tim Miner 705-566-9632 

PET Educators Group (Windsor) 

— meets at Windsor Separate School Board Media Centre, 1485 
Janette Ave. on the 3rd Wednesday of each month (not July <k 
August) at 7 p.m. 

Contact John Moore 519-253-8658 

UNITED STATES 

Boston Computer Society/Commodore Users Group 

— meets at Minute Man Tech High School, kt 2A (just off kt 128) 
in Lexington, MA, every 2nd Monday of the month, at 7p.m. 
Contact Harvey W. Gendreau 617-661-9227 

Commodore Houston Users Group ( Texas) 

— Clear Lake Chapter— Nassau Bay City Hall, NASA koad #1, on 
the 1st Wednesday ol each month at 7 p.m. 

— Central Chapter— Farrish Hall, University of Houston main campus 
-NW Chapter- Bleyl Jr. High School, 10,000 Mills Rd. (Cypress- 
Fairbanks SO), on the 3rd Thursday of each month at 7:30 p.m. 

— Klein Chapter -Hildehrandl Middle School, 22,800 Hildebrandt 
kd. (Klein ISD), on the 3rd Tuesday ol each month (except July 
& August) at d:30 p.m. 

Contact Mary F. Howe 713-376-7000 

Genesee County Area PET Users Group (Michigan) 

— meets at Bentley High School on Belsay Rd.on the 3rd Thursday 
ol each month at 7 p.m. 

Contact Gordon Hale 313-239-1366 

Greater Omaha Commodore 64 Users Group 

— meets at South Omaha campus of the Metropolitan Technical 
Community College, 27th and Q Streets, in Room 120 of the 
Industrial Training Center, on the first Thursday of the month 
at 7 p.m. 

Contact Bob Quisenberry 402-292-2753 

Manasota Commodore Users Group (Florida) 

— meets on the 2nd and 4th Thursdays of the month at 7 p.m. 
Contact Roberto O. Bronson 813-747-1785 



Michigan's Commodore 64 Users Group 

— meets at Warren Woods High School in Warren, on the 3rd 
Tuesday ol each month at 7 p.m. 

Mohawk Valley Commodore User's Group (New York) 

— meets at the Clara S. Bacon School in Amsterdam, NY, at 7 p.m. 
on the second Tuesday of the month. 

Contact William A. Nowak 518-829-7576 

Russellville CUG, Inc. (Arkansas) 

— meets at Oakland Heights Elementary School on the 3rd Thursday 
of each month at 7 p.m. 

Contact Bob Brazeal 501-967-1868 

Sacramento Commodore Computer Club (California) 

— meets at Kit Carson High School on the 4th Monday of each 
month at 7 p.m. 

Contact Geoff Worstell 916-9^1-8699 

Southern Minnesota Commodore Users Group 

— meets at Mankato State University on the first Thursday of each 
month at 7:30 p.m. 

Contact Dean Otto 507-625-6942 

Westmoreland Commodore User's Club (Pennsylvania) 

— meets at Westmoreland County Community College (Youngwood 
PA) on the 3rd Friday evening of each month 

Contact Bob McKinley 412-863-3930 

INTERNATIONAL 

Baden Computer Club (West Germany) 

— meets at CFB Baden-Soellingen on the 2nd Sunday of each 
month at 7 p.m. 

Contact Ben Brash 



D1SKAUGNER 

FOR YOUR 1541 DISK DRIVE! 

In less than an hour, wiih just a Phillips screw- 
driver and the DISKALIGNER Disk, you can 
pul your 1541 back on line, perfectly realigned! 



$29.95 Cdn. 



$24.95 U.S. 



(Ontario Residents add 7% Provincial Sales Tax) 



I, 



G.R.Q Marketing Ltd 

P.O. Box 197; 

Thornhill, Ontario 

L3T3N3 



1 



In the Toronto area DISKALIGNER 
may be purchased at Electronics 2001 
5529 Yonge St., Willowdale, Ontario 
M2N 5S3 (416)223-8400 



page 12 TPUG magazine 




PET/CBM MULTI USER DISK SYSTEM 

•ALLOWS UP TO SIXTEEN USERS TO SHARE DISK DRIVES 
AND/OR PRINTERS 

• WORKS WITH ALL PET/CBM EQUIPMENT 

• 100% HARDWARE INTERFACED 

• NO ALTERATIONSTOSOFTWARE OR SPECIAL SOFTWARE RE- 
QUIRED 

•SOFTWARE TRANSPARENT - WORKS WITH ALL PET/CBM 
SOFTWARE 

• LANGUAGE TRANSPARENT — WORKS IN ANY LANGUAGE 

• NO SPECIAL COMMANDS USED 

• PROTECTS AGAINST SYSTEM LOCKUP 




COMMODORE 64 MULTI USER DISK SYSTEM 

• ALLOWS UP TO EIGHT USERS TO SHARE DISK DRIVES 
AND/OR PRINTERS 

• WORKS WITH ALL 64/VIC EQUIPMENT 

• BUILT IN IEEE AND 64/VIC SERIAL PORTS 
(WORKS WITH ALL IEEE DEVICES) 

• 100% HARDWARE INTERFACED 

• NO ALTERATIONS TO SOFTWARE OR SPECIAL 
SOFTWARE REQUIRED — SOFTWARE TRANSPARENT 

• NO SPECIAL COMMANDS USED 

• BUILT IN 16K PRINT BUFFER 

• DISK DRIVE PRIORITY 



GREATER PRODUCTIVITY & LOWER COST 
FOR BUSINESS AND EDUCATIONAL USE 



4032 



8032 




40 TO 80 COLUMN CONVERSION 

• EXTERNALLY SWITCHABLE FROM 40 TO 80 COLUMNS 

• EXTERNALLY SWITCHABLE FROM 80 TO 40 COLUMNS 

• CONVERSIONS FOR BOTH 4032's AND 8032's 

• 100% SOFTWARE COMPATIBILITY IN EITHER MODE 

• HARDWARE (NOT SOFTWARE) MODIFICATION 

• ALL KEYS FROM 8032 EMULATED ON 4032 

• SPECIAL FUNCTION KEYS 







' 






^^% 


oco^^rs^ 


^_ 


K 


v* x v^^^^ 


► 


MIC 

•LO 
•RE 
•AL 

• IEE 

• WC 

• NO 

• ELI 
PR 


ROSHARE 64K PRINT BUFFER 

WCOST 

DUCES LONG WAITS — SAVES TIME 
_OWS YOU TO PRINT AND PROCESS SIMULTANEOUS 
E INPUT — IEEE OR CENTRONICS PARALLEL OUTPU' 
)RKS WITH ALL PET/CBM SOFTWARE 
INSTALLATION REQUIRED 

MINATES THE FRUSTRATION OF WATING FOR Y 
NTER 


LY 

r 

OUR 



COMMODORE U, PET. ANDCBM ARE ALL TRADEMARKS OF COMMODORE BUSINESS MACHINES. INC 



MANUFACTURED BY: 

COMSPEC COMMUNICATIONS INC. 

153 BRIDGELAND AVE, UNIT 5, 
TORONTO, ONTARIO M6A 2Y6 
(416)787-0617 



TPUG magazine page 13 



LASER PROJECTIONS 

A Meeting Of Art And Technology 




Greg Lowry 

Toronto, ON 

Introduction 

A dynamic art of pure projected light may have been one of 
mankind's ancient dreams, induced by the flickering campfire 
glow as it played across the rock walls of our ancestors' cave- 
dwellings. The constant flux of projected light forms must have 
been a powerful stimulus to the imagination and emotions ol 
primitive man. 

During the seventeenth, eighteenth and nineteenth centuries, opti- 
cal theories and experiments performed by Newton, Goethe, 
Chevreul and others gradually laid foundations for the concept of 
a fine art of projected light. Later, impressionists concerned them- 
selves with the technology of vision (albeit superficially). Their art 
reflected an interest in light and motion, and in the sciences which 
sought to explain them. Their philosophies gave rise to the notion 
that art might someday have as much to do with the traditions of 
science as with the traditions of art. 

Traditionally, the arts and sciences have been considered mutu- 
ally exclusive endeavors. The scientist, working within natural 
laws applied to hard devices and machines, had little to do with 
artistic experimenting as applied to ephemeral forms. Arts and 
sciences are so close today that there is an interplay of disciplines. 
Their convergence has been stimulated by the advances of our 
scientific and industrial technology, with its offerings of new and 
better means of generating and manipulating light, and novel 
methods of storing and processing information. 

In the late 1960's a novel form of light display combined a variety 
of projection media — film, slides and overhead projectors. The 
"light show" flourished as a visual accompaniment to the emergent 
rock music of that era. Scientists and artists in those years began to 
speculate that the ancient vision might be realized by using one of 
the greatest technological innovations of the age — the laser. 

Today, lasers are being widely applied in the sciences. The word 
"laser" has become associated with much "state of the art" technol- 
ogy such as nuclear fusion, holography, and data recording and 
transmission. Against this extensive utility, it is not surprising that 
a potential for art was recognized. 



The Laser 

The laser works somewhat like a fluorescent light bulb. An electric 
current is sent through a gas-filled glass tube. When enough power 
is applied, the gas begins to glow. However, in a laser, partially 
silvered mirrors at each end of the tube bounce the light particles 
back and forth until they pack enough power to shine through the 
mirrors. The result is an extremely thin high-energy beam of 
photons blasting tightly in the same direction. 

In today's marketplace, there are a variety of ion lasers. The HeNe 
(Helium Neon) laser produces only one ruby red spectral line at a 
wave-length of 632.8 nm. A mixed gas KrAr (Krypton Argon) laser 
will produce several lines of varying intensity from red to ultra 
violet. A Krypton laser is most efficient in red. With soft coated 
optics, however, it can also reveal yellow/green and blue lines. An 
Argon ion laser has six lines within the blue/green portion of the 
spectrum. 

Color Separation 

A common means of gaining access to individual colors is to beam 
light from a Krypton or Krypton-Argon laser into a littrow or 
equilateral prism to extract spectral components. Separate beam 
colors can then be controlled with simple On/Off shutters, acousto- 
optics or beam intervention techniques. 

Projection Methods 

A) Scanned Image Generation 

There are a variety of laser effects machines on the market which 
generate two-dimensional patterns through the use of dual axis 
galvanometer scanners. This electromechanical device rotates a 
small mirror which is attached to its shaft. In order to get two 
orthogonal (horizontal and vertical) axes, two scanners are posi- 
tioned at right angles to one another so that the beam is reflected 
off both mirrors. Simultaneous movement of both scanners will 
move the laser beam in complex trajectories. In 'reality' at any 
given instant there is only a single dot moving so rapidly that the 
pencil beam (due to the phenomenon called 'persistence of vision') 
appears as a solid line image. (See Graph 1) 

Open loop scanners are capable of covering sixty degrees of visual 
angle. Position feedback (closed loop) scanners use signals corres- 
ponding to both current position and velocity. These permit extreme 
accuracy in translation of input signal into mirror displacement. 
They do not suffer from the non-linearities and open-loop distor- 
tions associated with other scanners. A typical closed loop scanner 
obtains 2 KHz bandwidths over a wide scan angle and 3.5 KHz at 
lesser deflections. This means that the mirrors on the scanners can 
be oscillated at these frequencies. 

If the feedback path is broken, and an appropriate computer and 
peripherals are placed therein, a memory of images becomes 
available, as I will describe later. As well, actual letter writing, 
logos and representational imagery are possible. Laser graphics 
require the design of a system where the bandwidth of scanners 
places the upper bound on the complexity of the imagery while 
still allowing for real-time transformations. Bandwidth limitation 
is due to the inherent mechanical limitations of the electro-magnetic 
galvanometer, such as the inertia of its mirror. 



page 14 TPUG magazine 



The most familiar method for image synthesis is accomplished 
through the use of standard electronic waveform generators oper- 
ating scanners to produce Lissajous figures. For example, two 
equal amplitude sine waves of the same frequency (90 degrees out 
of phase with one another) form a circle centered at the origin. (See 
Graph 2). This is the basic quadrature oscillator. More complex 
abstract designs, with a circular motif, can be achieved by summing 
a number of waveforms from oscillators tuned at harmonic 
frequencies, followed by control signals from a rotator circuit. 



Graph 1 



scanner 
*y axis' 

torque 
action of 
mirrors 





90° 180* 270° 360° 
two signals 90° phase shift; sine 
& cosine wave fed to their respective 
scanners quickly reveal simple quad- 
rature resultant, a circle 



C' negative 30° 
B origin of rest 



incident 
laser 
beam 

JV fjr zfK positive 30° 

position A X. 

positive 151 _ _ 3 

rest position^B' "Z. 

negative 15°_--- rf " ^ 

position C polar view of scanner mirror 

*note . . . the projection angle is twice the deflection angle relative to the 
incoming beam or plane of light 

Representational images can also be produced. The ability to 
enter hand-drawn graphics by bit pad, and to do frame animation 
by sequential accesses of stored points, immediately makes a digi- 
tal system which is more versatile than an analog system. This 
technique of image design is very similar to sprite programming 
on the Commodore 64. See photos for examples of these images. 

Animated sequences can be stored on magnetic tape with the use of 
an FM encoding system. The X and Y positions of the laser beam 
are stored as two signals on the tape. Once recorded, any projected 
shape can be repeatably reproduced whenever the tape is played. 
A third signal, in addition to the X and Y, blanks the laser beam. 
This makes it possible to display images with broken or discontinu- 
ous lines. If the magnetic tape also carries recorded music, on 
separate tracks from the animation signals, exact synchronization 
between the music and visual images is easily achieved. 




B) Raster-Scanned Images 

It is possible to scan lasers to generate a raster which complies with 
N.T.S.C. standards- A rotating polygonal mirror provides the 
fixed-frequency 15.75 KHz horizontal deflection, while a precision 
scanner steps through the 60 Hz vertical staircase wave form. 
Combinations of red, green and blue allow for any color from soft 
pastels to vibrant primaries anywhere within the image. In the 
1920's and l 30's, when various methods of producing television 
pictures were being tested, this type of mechanical scanning was 
tried. At that time, lasers did not exist. Without them, mechanically- 
scanned images could not be produced with good definition, and 
this technique was discarded in favour of the cathode-ray tube. 
Nowadays it is being revived as one of several possible methods of 
producing very large TV pictures. 

C) Non-Scanned Image Formation 

Another method of image generation depends on transmission 
modulators which interact with the laser beam's phase coherence. I 
regard these as compositional instruments which are unlike any 
scan technique. This class of imagery may involve reflection, 
refraction, diffraction or interference dispersion. Translucent mate- 
rials act to portray complex interference patterns such as galaxies, 
nebuli, clouds, and a myriad of others. Diffraction gratings also 
provide a technique of image multiplication with various densities 
and arrangements. 




TPUG magazine page 15 



GRAPH 2 
some system block diagrams 
analog galvo scanning 



LASER 



















vertical 

galvo^- ^ 

Z^^ "y" 






signal 
generators 




signal 
processing 








scanner 
amplifier 






signal 
mixing 


— *• 














signal 
generators 


signal 
processing 


scanner 
amplifier 


















* 








. 




horii 






control 
(your input) 






joystick 

for x — y 

positioning 





























(control can be keyboards, knobs, sliders, pedals, analog memory etc.) 






















Scanner 
Amplifiers 


* 








* 1 








k 








Analog 
Control 
as above 






J \ ^. , 










j 










































Data 
tablet of 
Bit Pad 










Digital 
to Analog 
Converter 








Computer 








it 




































disk, tape, 
EPROMS ETC. 


(analog/digital position detector scanning system) 



Digital Techniques 

Digital computer technology plays a part in several stages of the 
production of a laser display. For example, outlines of three- 
dimensional objects are often needed. These can be generated 
digitally by feeding a computer with a set of co-ordinates represent- 
ing the three-dimensional shape of the object, then processing 
these to project a two-dimensional outline. This can be done repeat- 
edly to portray the object in various orientations, and the sequences 
of images can be recorded on magnetic tape, as described earlier. 
When the tape is played through the laser projection system, an 
animated, moving image of the object is produced. 

Digital storage can also be used, in place of magnetic tape, to hold 
the instructions for the production of images. A sequence of numbers, 
representing successive X and Y positions of the laser beam, is 
burned into an EPROM. The projection equipment can read these 
numbers back to produce the image. The system which I use 
contains many of these pre-programmed images, which I can call 
up whenever I need them. 

Conclusion 

A dry, technological description of the processes which are used in 
laser projection can do little to portray the artistic aspect of my 
work. In the creative process, I experience a sense of intimate 
connection, a human interaction with software and hardware. This 
linkage of the thought and emotion of the inner world with the 
high technology of the outer world is, to me, a revelation which 
creates a vision of a new reality. TPUG 



(Editor's Note: The use of Commodore computers to drive lighting- 
equipment similar to that which Mr. Lowry has described is a topic which I 
y hope the Hardware Chapter will investigate next spring). 




page 16 TPUG magazine 



IT STARTED IN '81 when our president, 

the designer of the VIC-20, left 

Commodore to open his own company. 

His goal was to build an American 
tradition ... THE BETTER WAY. 



***** 




**** 



o*-° 



Commodore produced good computers 
that were economical for families. 
Our president wanted to provide 
Commodore owners with better 
peripheral products. 

In less than two years, MSD was 
shipping interfaces that expanded 
the Commodore 64, VIC-20, and 
PET computers into business and 
developmental applications ... THE 
SERIOUS WORLD OF COMPUTING. 

Next, determined to BUILD IT BETTER, 
MSD developed SUPER DISK I and II ... 
exceptionally fast and durable disk 
drives that NEVER OVERHEAT. 

MSD's dual drive formats, copies, and 
verifies in less than two minutes ... 
compared to 30 or 40 minutes with 
TWO Commodore 1541s. This 
unparalleled speed has made SUPER 
DISK II the hottest product introduced 
for the Commodore line of computers! 

Add the six month warranty, and you 
can see why our dealers and their 
customers believe in us. MSD 
SYSTEMS, INC. ... Call us today for 
your nearest local dealer. 




Our RS-232 Serial Interfaces allow vou to 
connect printers, modems, plotters, ana other 
input/output devices to your 64 or VIC-20. 



"?: 



A parallel interface allows direct access between a 
Centronics printer and your software program, 
saving you loading and waiting time. Our CPI is 
compatible with most software written for the 64 
and VIC-20. 




For professional-quality video and audio output, 
our Monitor Link Cables can connect your 64 
or VIC-20 to a high-resolution black/white or 
color monitor, or a CRT terminal, and to a stereo 
system. 




The CEX-4 Expandoport gives you four additional 
ports for interlaces and peripherals. 




Save time and hassle with the greater 
speed of an IEEE Interface. The unit is 
'transparent' to your computer's expansion port, 
allowing hookup to any peripheral without 
interference. With this inteirace, your 64 or 
VIC-20 can gain CBM/PET-type control over the 
IEEE-488 bus. 

Dealer and distributor inquiries invited. 




10031 Monroe Dr. • Suite 206 • Dallas, Texas 75229 
214-357-4434 • Outside Texas 800-527-5285 












TPUG magazine page 77 




Programmers Guild Products Lid. 



255 ManuLife Place 

10180- 101 Street 

Edmonton, Alberta T5J 3S4 

Telephone (403) 428-6229 



5 W DISKS 

1 00% Certified 
SSDD — $ 1 .60 
DSDD — $2.50 



Minimum Quantity 50 Disks Per Order 
VISA ACCEPTED] 
Money Back Guarantee If Not Fully Satisfied 




Introducing xCOM - the total communications 
software package for the Superpet. (6502 Side) 
Features include: 



- XMODEM protocol for file transfers. 

- Multiple baud rates - 300 to 19,200. 

- 20K screen scrolling buffer 

- Complete disk and printer interfacing 

- Line edit mode. 

- Communications status line on screen. 

- And much much more. 

xCOM $79.95 xCOM 64 $59.95 for CBM-64 




VIC 20 and Commodore 64 
are trademarks of 
Commodore Electronics Lid 
CBM Superpei 
Trademarks of Commodore 
Business Machines 



nomad 

by Genesis 

- Step motor driven from 

CBM - 64 
■ Joystick controls or 

program controls. 

Learning mode. 

Ultrasonic scanning. 

$275.00 




Also Ask About 

VIController 

Wireless remote control 
system for the VIC-20 
and CBM-64. Use with 
BSR and Leviton remote 
receiver modules. $89.95 



COMsense 

Input device for the 
VIC-20 and CBM-64. 
Provides 4 open/close 
and 2 analog inputs. 
$64.95 



COMclock/ 
AUTOboot 

Clock/calendar cartridge 
for CBM. 64 with battery 
backup and auto-start 
software in ROM. $89.95 



COMvoice 



by Genesis 



.men .<-*R 

— Milne's Computer Control Systems 62 Wood Crescent Regina, Saskatchewan S4S 6J7 Ph: 1-306-584-1988 



A speech synthesizer 
that extends the 
power of speech to 
Commodore 64. 
English-to-Speech 
conversion. $154.95 

W/Exiernal Speaker $169 95 



page 18 TPUG magazine 



Bennett's tutorial - Relative Files 






o 

Q 
I 




Chris Bennett 

TPUG Business Manager 

One of the most common questions I am asked at meetings is: 
"How do I use Relative files?". Because of this, I presented two 
sessions on relative files at the Annual TPUG Conference in May 
1984. They proved very popular. This article is basically a sum- 
mary of what I presented at those sessions. 

Let's first discuss the relative merits of sequential files versus 
relative files. Sequential files are easy to use and pack a lot of data 
in a small space. However, they must be read sequentially from 
beginning to end. If the data you want is near the end of the file, all 
information before it must be read and bypassed. If you wish to 
update information in a sequential file, you must either read it all 
into memory, update, and then write it all back out, or you will 
have to read the old file and write out a new file as you update the 
information. 

Relative files (or direct access files) are not used this way. Once a 
relative file has been created, any record within that file can be 
read in, updated and written out. The one major restriction is that 
all records in a relative file must be the same length. This can cause 
a waste of space since you must set the record length to equal the 
largest piece of information that you will be processing. 

In the listing included with this article is a sample program that 
creates, reads from and writes to a Relative File. It is written for 
BASIC 2.0 machines such as the VIC 20, Commodore 64 and 
BASIC 2.0 PETs. At the end, I will show you how to change it for 
the BASIC 4.0 machines (ie. 8032, 4032, PLUS/4 and Commodore 
16). 

The first thing you must do is OPEN the command channel (line 
210) and the last thing you do is CLOSE it (line 370). The command 
channel is used to send commands to the disk drive and to read 
error messages from the disk drive. Closing the command channel 
at any time will also close all other files. 

Using relative files is usually done in two parts. First, the relative 
file must be created. The number of records needed and the length 
of the records are specified in this creation process. The program 
logic needed to create 40 records of 100 characters each can be 



found in lines 1000 to 1110. The OPEN command in line 1010 sets 
up the parameters but does not actually create any records. The 
name of the relative file is TEST. The characters ",L," must follow 
the name within the quotes and the record length of 100 is specified 
by +CHR$(100) at the end of the OPEN. GOSUB 9010 is a subrou- 
tine that reads the error channel and returns the error number in 
the variable DS. Always check this variable after each disk operation. 
To set up 40 records, we must point to the 40'th record in the file 
and write something to it. Lines 1040 to 1060 set the record number 
to 40 and check the disk status (in this case, it must be 50). Lines 
1070 to 1090 print data to that record and check that the disk status 
is zero. You will notice a short pause for a few seconds as the disk 
drive creates the space for those 40 records on your diskette. The 
file is then closed and we have finished creating the relative file. 

Now we are ready to read or write to the file. The subroutine at line 
2000 to 2190 gets some data from the keyboard and writes it out to 
the file TEST. Note the format of the OPEN command in line 2010. 
We no longer have to tell the disk drive the length of the records, as 
this is stored as part of the relative file. Line 2020 and 2030 read the 
error status and make sure that it is zero. Lines 2040 to 2100 get the 
record number we are going to write to, plus four pieces of data. 
Lines 2110 to 2130 set the record pointer. Line 2140 builds a string 
of the data we are going to write. Each field is followed by a 
carriage return C$ (set in line 230 at the beginning of the program). 
Lines 2150 to 2170 write the data to the record. A carriage return at 
the end of the record is not needed as the disk drive can tell where 
the end of a record occurs. 

The subroutine to read is found at lines 3000 to 3220. The OPEN 
command is the same. In my example, I open and close the file for 
each read and write of a record. This is not necessary. The file 
should only be opened once at the start of processing and closed 
when everything is finished. The OPEN statements at lines 2010 
and 3010 will open the file for both input and output. The IF 
statement at line 3120 is needed to check for a record that is empty. 
If you INPUT from a null record, you will get a value of CHR$(255) 
returned. 

The one tricky part to relative files is the setting of the record 
pointer. This is done in lines 8000 to 8050. A set of six characters are 
sent to the disk drive over the command channel to tell it where to 
position itself. First, we send a lower-case 'p\ Next, we send 
CHR$(96+2) where 2 is the secondary address used in the OPEN. 
The secondary address is the third parameter and can vary from 2 
to 14. If the open command were OPEN 5,8,4". . . " then we would 
use CHR$(96+4). The third and fourth characters sent represent 
the record number. This number can be from 1 to 65535 and 
requires 16 bits (2 bytes) to represent it. The low order 8 bits first, 
followed by the high order 8 bits. The last values sent are the 
starting position within the record, followed by a carriage return. 

BASIC 4 PROGRAMMING 

If you have BASIC 4.0, you may make a couple of changes to 

simplify the program. First, the error channel is not needed (Delete 

lines 210, 370 and 9000 to 9020, plus any reference to GOSU B 9010). 

Replace line 1010 with DOPEN#l,"TEST",D0,L100 and replace 

lines 2010 and 3010 with DOPEN#l,"TEST",D0. Finally, replace 

lines 8010 to 8040 with RECORD#l,(R). TPUG ■> t . , 

continued overleaf 



TPUG magazine page 19 



l yy 

110 

128 
139 
140 
150 
160 
170 
180 
190 

200 

210 
230 
240 
250 
260 
270 
230 
290 

380 

3 1 
320 
330 
340 
350 
360 
370 
330 

1 000 
1001 
1002 
1 003 
1 004 
1010 
1020 
1030 
1040 
1050 
1 060 
1070 
1 0S0 
1 090 
1 1 00 
1110 
2000 
2001 

2002 
2>H 1 
2020 
2030 
2040 
2050 
2060 
2070 
2080 
2090 

2100 

2110 
2120 
2130 
2140 
2150 
2160 
2170 
2180 
2190 

3000 



REN 
REM 
REN 
REN 
REN 
REN 
REM 
REN 
REN 
REN 



****************************** 



RELATIVE FILES 2.0 



BV 



CHRIS BENNETT 



* 

* 
# 

* 
* 
* 



****************************** 



OPEN 15,3,15, " 10" 

C*=CHR*<13> : REM CARRIAGE RETURN 

Q#=CHR*<34>: REM QUOTE 

T*="REC# :NAME sflDDR sPHON :MEM# : " 

PR I NT" 3"; 

PR I NT" 1BBI9 - EXIT" 

PRINT"HH1 - CREATE FILE"' 

PRINT"HS2 - WRITE FILE" 

PRINT"HB3 - READ FILE" 



INPUT"HBSELECT 



IP A$="* u 
IF A*="l" 
IF fl*="2" 
IF fl*="3" 

IF fl$O"0 
CLOSE 15 
END 

REM ** 
REM ** 

REM ** 



THEN 
THEN 
THEN 
THEN 
' THEN 



OPTION 
260 



*IMI";A* 



GO 

GO 



UB 
UB 
UB 



1 1 

2010 
3010 



CREATE RELATIVE FILE 



4U RECORDS IN 
RECORD LENGTH 



FILE 
OF 100 



** 
** 
** 



' : TEST , L , " +CHR* ( 1 OO .: 



OPEN 1,3, 

GO SUB 9010 

IF DS09 THEN CLOSE 1 : STOP 

R=48 : GOSUB 30 10 

GO SUE: 9O10 

IF DSO50 THEN CLOSE 1 : RETURN 

PRINT#1,CHR*'::255;'; 

GOSUB 90 1 

IF DSO0 THEN CLOSE 1: STOP 

CLOSE 1 

RETURN 

REM ** WRITE RELATIVE RECORD ** 



CLOSE 1 : 
Hill 



RETURN 
;R# 



OPEN 1 ,3,2, "O: TEST" 
GOSUB 9010 
IF DSOO THEN 
INPUT " ZMMBlgF ECtt 

r=vrl<r$} 

if r<1 or r>40 then 2040 

INPUT"SNflME *||||" ;NA* 

INPUT"aRDDR *||||" ;AD* 

INPUT"SF , HON +1111 ;PH* 

I NPUT " S1EM# +IMI ; MM* 

GOSUB 8010: 

GOSUB 9010 

IF DSO0 THEN CLOSE 1: STOP 

F*=R$+C*+NA*+C*+AD$+C$+PH$+C$+MM$ 

PRINT#1,F$; 

GOSUB 9019 

IF DSO0 THEN CLOSE 1: STOP 

CLOSE 1 

RETURN 



REM SET RECORD PTR 



3001 

3002 

3010 

3O20 
3030 
3040 
3050 
3060 
307O 
3080 
3090 

3100 

3110 

3 1 20 
3130 

3 1 40 
3150 
3160 
3170 
3180 
3190 
3200 
3210 
3220 

3000 
3001 

8002 

3010 

302O 
3030 
8040 
8050 

9000 
900 1 

9002 

9010 

90 1 5 
9020 



REM ** READ RELATIVE RECORD ** 

OPEN 1, 3, 2," O: TEST" 
GOSUB 9010 

IF DSOO THEN CLOSE 1 : RETURN 
INPUT"3fiI5ISfi^EC# Hiir.rR* 
R=VflLCR#> 

IF R<1 OR R>40 THEN 3040 
GOSUB 8010: REM SET RECORD PTR 
GOSUB 9010 

IF DSOO THEN CLOSE Is STOP 
FOR 1=1 TO 5 
: INPUT#1,D#< I> 

: IF D*<I>=CHR*<255> THEN 1=5 
: GOSUB 9010 

: IF DSOO THEN CLOSE 1 : STOP 
NEXT I 
PRINT"HH" 
FOR 1=1 TO 5 

: PRINT MID$'::T*,I*5-4,5::<,D*a::' 
NEXT I 

GET A*: IF A* OCHR* (13) THEN 3200 
CLOSE 1 
RETURN 

REM ** SET RECORD NUMBER ** 

p:f-="P ,, +CHP*>:'.96+2:< 

P*=P*+CHR*<R AND 255>+CHRf <R.-'256 l 

P$=P*+CHR*<1 > 

PRINT#15,P* 

RETURN 

REM ** READ THE ERROR CHANNEL ** 

INPUT#15,D3,E2*,E3,E4 

IF DSOO AND DSO50 THEN PRINT DS,E2* 

RETURN 



* 




* 


Important message to all 
BBS users 




The TPUG BBS has 






moved again! 
The new telephone number is, . . 






(416)782-9534 






Its operating hours are. . . 

24 hours per day. 

7 days per week. 

The password is. . . 






Humidity 




* 




* 





page 20 TPUG magazine 




tUeue Gd 
Veepk Toteg 



REVIEWERS SAY: 

"This is the best typing tutor 
we have seen yet; ••••+" 

INFO-64 I TTPOTG TUTOR 

"Computer aided instruction at 
its best." Commander 

"This is an excellent program 
that makes typing practice an 
enjoyable pastime instead of 
boring drudgery." 

DILITHIUM PRESS 

Rated the BEST educational 
program for the VIC 20 

Creative Computing 

CUSTOMERS SAY: 

". . . delighted with my son's 

progress ... he is the only one in his second grade class 

who touch types at the computer." 

"Your Typing Tutor is an excellent program . . . our 4 
children literally wait in line to use it." 

"Thoroughly satisfied, can't believe how fast I've learned to 
type. I've never typed before." 

In daily use by schools across the USA. 

TYPING TUTOR + WORD INVADERS 

Commodore 64 T T Tape $21.95 

Commodore 64 T " Disk $24.95 

VIC 20™(unexpanded) Tape $21.95 

REALISTIC AIRCRAFT RESPONSE 

"Has a quality of realism which 
sets it apart from others, even 
those I've tested in flight school." 

Compute's Gazette 
"Great program!" INFO-64 

"It is tremendous fun." 

Compute's Gazette 

"Flight tested by an air traffic 
controller, two skilled pilots and 
an elementary school class. 
Highly recommended by all." 

Midnite Gazette 
"This is an unbelievably realistic 
simulation of the difficulties 
facing a pilot in instrument fly- 
ing. I'm a 747 pilot and I think that this simulation could do 
a lot to improve the reactions and instrument scan habits 
of even very experienced pilots." 747 pilot 

IFR (FLIGHT SIMULATOR) 

Commodore 64™ Tape or Disk $29.95 

VIC 20™(unexpanded) Cartridge $39.95 

JOYSTICK REQUIRED 

"^g^ Shipping and handling $1.00 per 'dMK 
^^^m order, CA residents add 6% tax. iwP 

ACADEIiW 

SOFTWARE 

P.O. Box 6277 San Rafael, CA 94903 (415) 499-0850 

Programmers: Write to our New Program Manager concerning 
any exceptional Commodore 64 program you have developed. 





WAT 



Products for the Commodore 64 



Waterloo Structured BASIC 

Already widely used on the Commodore PET, 
the package augments the standard BASIC with: 

• Structured Programming Statements : 
programs can be written with proper style. 

• Procedures : eliminate the use of GOSUB; 
instead CALL named procedures 

• Additional Commands : increased ease of use 
with AUTO, DELETE and RENUMBER 
commands 

Each package contains: 

• cartridge containing software 

• comprehensive textbook containing both a 
primer and a reference manual 

Price: $99.00; $79.00 for additional packages in 
same order 

WATCOM Pascal 

This interpreter supports the full ANSI standard 
Pascal (with one omission) and features: 

• 



integrated full-screen editor 
interactive debugger 
support for printer, disk and cassette 
graphics library 
peek and poke functions 
Each package contains 

• cartridge and disk containing the software 

• comprehensive textbook containing both a 
primer and a reference manual 

Price: $149.00; $99.00 for additional packages in 
same order 

Ordering Information 

Order forms and/or additional information may 
be obtained from: 

WATCOM Products, 
415 Phillip Street, 
Waterloo, Ontario 
Canada, N2L 3X2 

(519) 886-3700 
Telex: 06-955458 

Additional textbooks are also available. Seminars 
on Pascal and BASIC are offered regularly. 



TPUG magazine page 21 



THE BEGINNER AND THE DISK - Part IV 



David A. Hook 

Barrie, ON 

We proceed with the series designed to address elementary disk 
handling techniques. Part I (June issue) looked at diskette care, 
formatting and initializing. Part II (July issue) introduced the 
DOS Wedge, disk error checking, and the BASIC 4.0 disk com- 
mands (found on PET/CBM, and also as part of VIC 20/C-64 
"extensions"). Last issue, we concentrated on loading and saving 
programs, and mentioned "wild cards" and "pattern matching". 
This month, we'll continue the discussion of DOS (Disk Operating 
System) features with a look at VALIDATE and SCRATCH. 

To demonstrate what is happening, we need an example, so let's 
use the following disk "directory" to work from: 






'DATA DISK FOUR 


" D4 2A 


20 


"ACCOUNT.A" 


PRG 


12 


'ACCOUNT.B" 


PRG 


8 


"ACCOUNT.C" 


PRG 


11 


"ADD.CUST" 


PRG 


11 


"ADD.INDX" 


PRG 


42 


"ACC.CUST" 


PRG 


23 


"ACC.INDX" 


PRG 


12 


"RATAFRATZ" 


PRG 


11 


"RATATATZ" 


PRG 


8 


"ADMIN. Al" 


PRG 


16 


"ADMIN. Bl" 


PRG 


37 


"STATS. PRG" 


PRG 


14 


"STATS.TXT" 


PRG 


20 


"STATS. INS" 


PRG 


13 


"ADDITION" 


PRG 


1 


"FILE" 


SEQ 





"MESSED UP" 


*PRG 



405 BLOCKS FREE. 

As a refresher, this was obtained with: 

LOAD "$0",8 (directory is a PROGRAM) 

>I0 (using the WEDGE utility) 

@$0 (alternate WEDGE command) 

CATALOG DO (BASIC 4.0 command only) 
DIRECTORY DO (alternate with BASIC 4.0) 

Only in the first example would you have lost the current program 
in memory. It was a LOAD command, remember! That's why you 
have become a devoted "WEDGER", isn't it? (See Part II for more 
evangelism on this topic). 

Anyway, this is the "disk" that we will be using to show the effects of 
some of the DOS exercises. Refer back to the above directory to 
study what has taken place after each exercise below. 

Validate 

Occasionally this disk command gets described as "verify", which 
is unfortunate. Confusion with the BASIC command of this name 
would make my description futile. So, excise "verify" from your 
mind, and concentrate on VALIDATE. And don't think this is an 
obscure command that you will never need! 

The directory above needs an application of the VALIDATE 
medicine. Where, you say? Look at the last entry, the one with the 
nasty "*" in front of the "PRG" designation. We have here an 
unclosed file, a ticking time bomb, as I may have said at least once 



before. Its file size is zero blocks — another flag that something is 
amiss. The attempted SAVE of the program failed, perhaps due to 
disk drive problems, a diskette flaw or a "DISK FULL" situation. 
With a data file, it's possible that you aborted the operation with- 
out closing the file. (Since we haven't mentioned data files yet, 
that's a topic for a future discussion). 

In any case, until you have done something with the problem, you 
won't be able to SAVE any more programs on the disk, so you 
should be satisfied that fixing this problem is the first order of 
business. But how, you say? Why not just SCRATCH this program 
and be done with it? Well, for two reasons: 

1. You don't know what SCRATCH is! 

2. You don't want to cause even more problems i 



r ith that diskette. 



While the first reason is somewhat frivolous (and will be rectified 
later in this session), the latter is important. There is only one 
proper way to eliminate an unclosed file from a diskette: the 
VALIDATE command. 



OPEN 15,8, 15 
PRINT#15, "V0" 
CLOSE 15 

>V0or 

@vo 



(all machines) 
(assume Drive #0) 

(with the WEDGE) 



COLLECT DO (BASIC 4.0 only) 

The letter "V" as part of a DOS command is an acceptable abbrevia- 
tion for us clumsy folks. Only in the first case do you need to 
explicitly OPEN and CLOSE the "command channel" (see Part I of 
the series) to perform a DOS command. 

I'll pause a moment while you rifle through your disk collection, 
trying to find that bum disk to work with. . . With our example disk, 
performing the VALIDATE takes a couple of moments (on the 
1541). When the red activity light goes out, the process is complete. 
Fetching the disk directory now will show that "MESSED UP" has 
disappeared. It is entirely possible that the "BLOCKS FREE" line 
will show a different (and larger) number. This depends on what 
caused the original error. Here, the number doesn't change. 

Anyhow, what's going on? 



The VALIDATE command serves to "clean up" the disk BAM 
(Block Availability Map). As you recall, the operating system 
needs to keep track of which sectors have been used, in order to do 
its job properly. An unclosed file causes some sectors (of the 
"incomplete" file) to get "allocated" improperly. What we want to 
do is free up all the sectors first. Then look at all the "properly"- 
used sectors (those that are actually part of full programs and data 
files). Mark those as being used, or "allocated". Then calculate the 
new total that is available, and keep that one. So, only the sectors 
that are used are shown that way, and our unclosed file quietly 
vanishes into the night. 

VALIDATE works by skipping through the pointers that "link" 
the sectors of a program together. If you choose to SCRATCH that 
unclosed file instead, there is a distinct probability that you can 
mess up a totally unrelated program. (For the technically-inclined 



page 22 TPUG magazine 



only: the pointers in the unclosed file could link up to a chain from 
another "active" program. This causes sectors of that program to be 
"freed" erroneously). You may not discover the mess until some- 
time later, when you try to LOAD the affected program, and the 
computer just crashes on you. Hence, the ticking bomb label. 

Amidst all this wonderfulness, there is a caution with VALIDATE: 
There is a certain type of data file, rarely used, that does not show 
in the directory. These "direct-access" files were used in the early 
PET days, before "relative" files were included in the DOS. A 
VALIDATE command done on such a disk will "free" the sectors 
where this information lies. Then a "write" to the disk will likely 
destroy the data right away. If you don't use commercial business 
software, it's unlikely that you will bump into this class of files. To 
be on the safe side, count the total number of blocks (free and used). 
If they total 664, you're not affected. It's a minor factor, but I 
thought it should be mentioned. 

If you remember nothing else from this lesson: don't SCRATCH 
those unclosed files from a disk; VALIDATE the disk! 

Scratch 

Now that you have been converted (baptism available at additional 
cost), it's time to introduce this very useful DOS command. You 
may have a disk with scads of unwanted programs. You may wish 
to dispose of an old version, in order to SAVE the current version 
of a program — using the identical filename of the "old" version- 
Suffice to say that there is a frequent need to get rid of a file from a 
disk. This is where the SCRATCH command comes in. I think that 
most everyone feels a little uneasy when the time comes; perhaps 
some practice will ease the anxiety. 

A little digression to deal with disk compatibility is in order. The 
various Commodore DOS types allow you to read disks that were 
prepared on 1540, 1541,2040,2031 and4040drives interchangeably. 
Unless you know for sure on which disk drive that disk was "formatted", 
you ought not to perform any write operation on it. This includes: 
SAVE, VALIDATE, SCRATCH, COPY, and RENAME (plus writ- 
ing data to files with "PRINTtt" instructions, which we haven't 
covered yet). When in doubt, don't do it — use a copy utility program. 
COPY-ALL and UNICOPY, both by Jim Butterfield, are the pro- 
grams I use for this job. Part I of this series has lots of command- 
ments like this that you can adopt as your very own guidelines. 

(Editor's Note: There is a rumour that some 1541'$ write disks slightly 
differently than do others. To be on the safe side, don't perform any 
"write" operation on a disk unless it was formatted on the actual drive 
which you are using). 

Let's refer to our example disk, and say that we wish to eliminate 
the program named RATAFRATZ from the disk. Here's the vari- 
ous ways it can be done: 

OPEN 15, 8, 15 (all machines) 

PRINT#15, "SOrRATAFRATZ" 
CLOSE 15 



>S0:RATAFRATZ 
@S0:RATAFRATZ 



(with the WEDGE) 



SCRATCH "RATAFRATZ", DO (BASIC 4.0) 

The "0" designation refers to Drive #0 of a dual drive system. You 
may leave it out with a single drive unit, but it doesn't hurt to 
include it. Note that Commodore BASIC 4.0 has the SCRATCH 
command built into the BASIC language interpreter. Once again, 
the WEDGE sequence is shorter to enter, and hence easier to use. 



continued overleaf 



WAT 



HANDS-ON WORKSHOPS 

Special Weekend Sessions 
For Microcomputer Users 

Hardware Design and Interfacing 

• Get over the fear of handling circuits and 
chips. 

• Understand what happens inside the micro. 

November 23-25, 1984 - Waterloo 

Pascal for Microcomputers 

• Learn one of the most popular and powerful 
languages. 

• Structured Programming is emphasized. 

November 16-18, 1984 - Waterloo 



WATCOM is the developer of language systems 
for the C64, SuperPET, IBM PC, ICON and has 
been offering computing workshops for over a 
decade. 

Call Sharon Malleck at 

(519) 884-2700 or mail the 

coupon for a detailed brochure. 

WATCOM Seminars 
415 Phillip Street 
Waterloo, Ontario 
Canada N2L 3X2 



Send more information on the following 
workshops: 

_ Hardware Design and Interfacing 
_ Pascal for Microcomputers 

Name: 

Address: 

City,Province: 

Postal Code: 

Telephone: ( _ _ ) 



TPUG magazine page 23 



You can use pattern matching, but do so with extreme care. For 
example: in a moment's weakness you divine that scratching all 
files starting with "RATA" will do the job. So you try: 



>S0:RATA* 



(WEDGE only) 



With a large disk directory, you may not have noticed that 
RATATATZ was also on the disk, and a check of the error channel, 
with: 



@ or 
> 



(WEDGE only) 



Gives the following message (if you did it this latter way): 

01, FILES SCRATCHED,02,00 

That signals that two files have been removed. Try not to outsmart 
yourself— I've made this mistake a number of times. (The comfort 
of being able to look inside the system and "unscratch" them was 
not a consolation for the stupidity). 

Since the pattern matching and wild card features can be useful, 
let's take some examples from our disk. We wish to scratch the first 
three entries from the current directory. Here is a trick that I use to 
check before I perform the scratch, when using these features. 
Display the disk directory first: 

LOAD "$0:ACCOUNT.:^, 8 (AS A PROGRAM) 

>$0:ACCOUNT.? (with the WEDGE) 
@$0:ACCOUNT.? 

Note that there is no version of the BASIC 4.0 CATALOG or 
DIRECTORY command that you can use to display a "selected" 
version of a directory. This was an error or an oversight in the 
interpreter design by Commodore. The designers of the BusCard 
(Batteries Included) and the C-64 LINK (Richvale Telecommuni- 
cations) both rectified this in their firmware. If you don't have 
these "extensions", then you'll have to resort to the above tech- 
niques to do this. 

The question mark in the filename is the "wild card" symbol, and 
means that all filenames starting with "ACCOUNT.", and fol- 
lowed by exactly one character, will be included. Display of the 
directory will show only the three files we want. Now slide the 
cursor back up to the directory command line (WEDGE version) 
and change the "$" to an "S" (and hit "RETURN"). When the 
cursor returns, the three files will be gone. The directory now 
looks like this: 






'DATA DISK FOUR" 


D4 2A 


11 


"ADD.CUST" 


PRG 


11 


"ADD.INDX" 


PRG 


42 


"ACC.CUST" 


PRG 


23 


"ACC.INDX" 


PRG 


8 


"ADMIN. Al" 


PRG 


16 


"ADMIN. Bl" 


PRG 


37 


"STATS. PRG" 


PRG 


14 


"STATS.TXT" 


PRG 


20 


"STATS.INS" 


PRG 


13 


"ADDITION" 


PRG 


1 


"FILE" 


SEQ 



(with the WEDGE) 



Now, I want to get rid of the two eight-character file names ending 
with "INDX". These are the various ways: 

OPEN 15,8, 15 (all machines) 

PRINT#15, "SO.-.^iVlNDX" 
CLOSE 15 

>S0:????INDX 

@so:^?;tndx 

scratch "????indx", do (basic 4.0) 

In the next case, I wish to scratch the program ADDITION. The 
directory command (WEDGE only): 

@$0:AD* 

yields: 






'DATA DISK FOUR" 


D4 2A 


11 


"ADD.CUST" 


PRG 


8 


"ADMIN.A1" 


PRG 


16 


"ADMIN. Bl" 


PRG 


13 


"ADDITION" 


PRG 



502 BLOCKS FREE. 

This is definitely more than intended. With a single file, it's often 
clumsier to use wild cards and pattern matching. Just type in the 
whole filename, and be done with it. 

For the final example, let's eliminate all the "STATS" programs. 
The customary directory command: 



>$0:STATS* 




gives: 




"DATA DISK FOUR" 


D4 2A 


37 "STATS. PRG" 


PRG 


14 "STATS.TXT" 


PRG 


20 "STATS.INS" 


PRG 



515 BLOCKS FREE. 

This is what we want, so cursor up to the WEDGE command, 
change the "$" to "S" as before, and the three will be gone from the 
directory. Our final directory looks like this: 



"DATA DISK FOUR" 


D4 2A 


11 "ADD.CUST" 


PRG 


42 "ACC.CUST" 


PRG 


8 "ADMIN.A1" 


PRG 


16 "ADMIN. Bl" 


PRG 


1 "FILE" 


SEQ 


586 BLOCKS FREE. 





468 BLOCKS FREE. 



I hope that the above exercises have been helpful. Please forward 
any correspondence through the Editor. Your comments and sug- 
gestions for future columns are welcome. While the letters received 
thus far have been mainly from "advanced" users, don't be shy 
about elementary topics. That's what this series is supposed to be 
about. TPUG; 

Note to Mr. T. Traub: your array example program worked perfectly 
for me, on both a PET and a C-64. I got no "FOR NEXT" errors, 
using the exact syntax you used. Sorry! 

To Be Continued. . . 



page 24 TPUG magazine 



-Introducing 

commodore 
reference diary 

Jim Butterfield 



Comm o d tum 



.the answer for 

Commodore 

enthusiasts 

— a combination 

computer 

reference book 
and date book! 






The Commodore Reference Diary is both a 
computer reference book and date book — the 
perfect combination for computer enthusiasts. 

In a convenient, pocket-sized format, the 
Commodore Reference Diary features a whole 
week per page spread in a clear, uncluttered 
format allowing plenty of room for those 
important. daily notations. 

The unique computer reference section features 
a complete listing of major computer shows 
across North America and Europe for 1985, plus 
extensive computer programming material and 
terminology, written by computer expert Jim 
Butterfield, is included for the Commodore 64, 
Vic 20, PET/CBM Series, B-Series, and Commo- 
dore 264 and 364* Memory lay-outs, screen 
codes, useful short programs, the machine 
language instructional set, kerna! subroutines, 
and much more! 



To tirder, fill out this handy coupon and return 
to: TPUG Magazine, 1912A Avenue Road, Suite 1, 
Toronto, Ontario, M5M 4AI, (416) 782-1861 



Please send me copy/copies of the Commodore Reference Diary 1985, 

141565, at $6.95 each. 

Add 5% for shipping and handling per order. 

1 enclose Cheque. Money Order (No COD's or cash), 

Charge VISA, Mastercard. 



Province Postal Code 

Price is subject to change without notice. 



141565 



$6.95 



Copp Clark Pitman Ltd., 495 Wellington Street West, Toronto Ontario M5V 1E9 (416) 593-9911 



The Commodore B-128 Computer 



Jim Butterfield 

Toronto, ON 

Copyright ©1984 Jim Butterfield. Permis- 
sion to reprint is hereby granted, provided 
this notice is included in the reprinted 
material. 

Commodore's B series computers have been 
coming for a long time. Now they have 
arrived — but not in Canada — and prom- 
ise to have a brief but glorious lifetime. In 
the United States, they are being sold as 
part of a very attractively-priced package 
by Protecto Enterprises (Box 550, Barring- 
ton, IL 60010). In Europe, there are a num- 
ber of them on hand (they are called 700 
series there); their sales situation isn't clear 
to me at this end. 

The B briefly emerged about a year ago; a 
number of machines leaked out to con- 
sumers. There was also a C machine, recalled 
by Commodore, which will not be available. 

Because of the unavailability of B-128 com- 
puters in Canada, it may be hard for TPUG 
to act as an information centre on these 
machines. Programs and information can 
be circulated as available, but no facilities 
will exist to check these in Toronto. 

B-128 Hardware 

The B-128 is low-slung and stylish; it 
requires an external monitor. The screen 
is 80 columns by 25 lines, similar to the 
8032, 8096, 8296 and SuperPET. No color 
or high resolution video is available. The 
style is still that of a Commodore machine, 
with screen editing taking place in the same 
way. 

Connection to disk and printer is via an 
IEEE-488 bus identical to that of PET/CBM. 
Standard Commodore IEEE peripherals 
attach normally. Cassette tape software is 
not in place, making the B-128 a disk- 
oriented system. There's an RS-232 interface, 
using- the standard RS-232 connector. With 
an ACIA chip built in, good communica- 
tions can be achieved. 

The 6509 processor is a close cousin of the 
6502. It can access "banks" of 64K memory 
via special registers mapped at addresses 
and 1, allowing 128K of memory (or in 
principle, even more) to be accessed. 



The Keyboard 

There's a big keyboard, complete with a 
numeric keypad and function keys. It's a 
change from previous Commodore layouts, 
and very close to the standard ASCII form. 
There are lots of keys. Separate CTRL 
(Control), ESC (Escape) and "Commodore" 
keys make special functions easier to im- 
plement. Cursor movement keys are sepa- 
rated from the main keyboard, and there 
are now four of them, so that no "shift" is 
needed. Display and program control keys 
are also neatly segregated. 

The numeric pad includes a double-zero 
key and a CE (Clear Entry) key, which 
wipes out an entire number you might have 
entered. There's also an extra RETURN 
key marked ENTER. There are ten func- 
tion keys, which can be used together with 
the SHIFT key to generate twenty functions. 
The first ten are predefined; the moment 
you turn the power on, they may be used. 
Any of the twenty can be re-defined by the 
user at any time. 

There are twenty-six "escape" sequences 
(ESC, followed by a letter of the alphabet) 
which do useful screen configuration jobs 
such as setting up windows. 
Big BASIC 

BASIC is upwardly compatible with previ- 
ous Commodore BASIC implementations. 
All previous BASIC commands and 
functions — including the 4.0 disk com- 
mands such as CATALOG, DLOAD and 
SCRATCH — are in place. Many new lan- 
guage features have been added. 
But BASIC programs saved from a B-128 
may be difficult to load to another Com- 
modore machine, due to "zero page chain- 
ing". The relocating loader on the C-64 
thinks the first line is the end of the program. 
This difficulty may be resolved wiith a sim- 
ple utility program; for example, MERGER 
from the TPUG library or from COMPUTE! 
October 1983, page 144, will do the trick. 
PRINT USING (and the associated 
PRINTftn USING) allows information to 
be printed neatly. For example, PRINT 
USING "#,###,###. ##";9876.789 will cause 
9,876.79 to appear neatly aligned within 
the space provided. 

Memory is arranged in "banks" of 64K each. 
You may pick a bank with the BANK 
command; this will affect commands such 
as PEEK, POKE, SYS, LOAD or SAVE; 



but you'll need to know what you're doing 
to find your way around in this vast memory. 
Machine language "boot" programs will 
use BLOAD and BSAVE commands, to- 
gether with complex "transfer sequences", 
to allow the various banks to intercommu- 
nicate. 

Error trapping is implemented to allow 
the programmer to catch problems as the 
program runs. Strings are 4.0 type — in other 
words, there's no problem with garbage 
collection delays. 

BASIC is generally noticeably faster. Be- 
tween the faster clock speed of the 6509 
chip, the IEEE bus and the elimination of 
the garbage collection, users will find this a 
speedy machine. 

There's a reset switch at the back of the 
machine which does a "warm start"; in case 
of emergency, you'll be able to recover your 
program. 

The 6509 

The 6509 chip can address more mem- 
ory — in theory, up to over a million bytes. 
But it works much like a 6502, which has 
addresses that can reach only 64K of mem- 
ory. How do we get all of memory? By 
"bank selection" — a process by means of 
which the computer can select one of sev- 
eral 64K slices, or "banks". 

Bank selection is a machine language fea- 
ture, and comes in two flavors. The easy 
part is data selection; we can change how 
the indirect load and store commands work. 
The two commands LDA (xx),Y and STA 
(xx),Y have been modified slightly so that 
they load data from or store data to a selected 
bank of memory. The bank is selected by 
the contents of address 1. 

It works this way. If, in machine language, 
I store a value into address 1, the LDA, 
indirect indexed, and STA, indirect in- 
dexed, will now draw data from whatever 
bank I have specified. For example: 

LDX #$02 
STX $01 
LDA (. . . ),Y 

will cause data to be loaded into the A 
register from bank 2, since we have stored a 
value of 2 into address 1. 



page 26 TPUG magazine 



To make a transition to a new bank, using 
address 0, we need very careful coding that 
is "synchronized" between the new bank 
and the old one. This coding is available 
— it's called "transfer sequences" — it han- 
dles all the details so that you don't need to 
know all the technical trivia that makes it 
all work. 

Software Availability 

Because the B-128 is likely to have a much 
smaller user community, programs written 
specifically for this machine will be in lim- 
ited supply. But many BASIC programs 
will load directly from other Commodore 
machines without any need to be adapted. 
Programs with machine language content, 
however, are unlikely to run without signifi- 
cant change. Many utilities will be initially 
unavailable; it seems likely that special inter- 
est groups of users will have to develop 
them for themselves. 

There is some custom software available; 
what IVe seen of it looks good. I'd advise 
users who think they might need the soft- 
ware to buy it now, since it might become 
hard to get. 

The B-128 contains a machine language 
monitor with extra features designed for 
the new architecture. Adding extra moni- 
tor features, such as a tiny assembler, is 
possible; but it's not a simple adaptation of 
existing monitor extenders such as SUPER- 
MON, since the MLM has a different style. 

Information Sources 

Commodore is rumored to be preparing a 
reference guide for the B-128; if so, that 
will be a valuable source of data. 



I have published memory maps of RAM 
and ROM for the B-128 in The Transactor 
magazine. The Great Reference Issue is 
long since out of print, but it will be pub- 
lished again soon. {The Transactor, 500 
Steeles Avenue, Milton, Ontario, Canada 
L9T 9Z9). 

There's a brief description of the B-128, 
plus an appendix giving a RAM memory 
map, in my book Machine Language for the 
Commodore 64 and Other Computers (Brady 
Communications, Bowie, MD 20715, $12.95). 
The B-128 is something of an exception in 
the Commodore line; in the book, I sug- 
gest that it's not the best machine for begin- 
ners to use when learning machine language. 
Even so, the map and description is there; 
and in the disk which optionally accom- 
panies the book, I give an example of a 
B-128 program complete with boot and trans- 
fer sequences. 

My "Commodore Diary 1985" (Copp Clark 
Pitman Ltd., 495 Wellington Street West, 
Toronto, Ontario, Canada M5V 1E9) is 
space-limited; but I did jam in an "archi- 
tectural sketch" and an abridged memory 
map of the B-128. 

B-128 information is a problem area. It 
seems likely that the total population of 
this computer will be less than ten thou- 
sand (as compared to millions of VIC 20's 
or Commodore 64's). As a result, there's 
limited profitability potential for books or 
software written specifically for this machine. 
Users will need to take care of themselves 



Yet it's part of the Commodore family, with 
many features in common with other ma- 
chines. And I feel sympathetic towards users 
and potential buyers who want more data. 

Bottom Line 

If you rate the things you like about a 
computer, the B-128 comes high on the list. 
It looks good. It has a fine keyboard. It's 
fast. It has lots of memory. Its BASIC lan- 
guage is very good. The B-128 has many 
convenience features, from screen controls 
to the reset button. 

But there won't be many of them. A B-128 
user will be something of an orphan — left 
to his or her own resources for many things. 
There won't be much software out there; 
there won't be many books. 

Many BASIC programs will adapt nicely. 
Machine language programs will mostly 
need some re-chopping ... at least, if you 
want to take advantage of the extra mem- 
ory space. 

The B-128 is late. When it was first shown, 
IBM wasn't seriously entrenched in the 
personal computer market. Now we have 
different concepts of what a "big" machine 
is, and the B-128 has lost some of its novelty 
and glamor. 

It's a good machine at an astonishingly 
attractive price. But you are on your own a 
little more than you would be with other 
Commodore machines. Is this the machine 
for you? Could be. . . if you're a little more 
independent than the average user. TPUG 




TPUG magazine page 27 



C-64 M/L Development System 



J. Allan Farquharson 

Paris, ON 

MICOL SYSTEMS is offering the user a 
chance to develop machine language on 
the Commodore 64 computer. Included you 
will find an editor, assembler and a monitor. 
An editor is usually a simple word proces- 
sor in essence. The assembler is the pro- 
gram which puts together the machine code 
made from the mnemonic code which most 
programmers use to write longer programs. 
That sounds involved, but if you write in 
BASIC or another language you know that 
subroutines and other code are put together 
to produce the program which collectively 
will do the job that it is written to do. Since 
machine code is rather lengthy, but very 
rapid, many subroutines are usually kept 
to do all the little jobs you wish to do over 
and over again. The monitor is a machine 
language program which allows one to look 
at various parts of memory in the com- 
puter and allows one to manipulate the 
code found there. Older Commodore ma- 
chines had a monitor built-in, but the C-64 
comes free of any such handy device. 

Before I am flogged to death, I hasten to 
mention that VIC 20 owners too may use 
this system. Most systems do not have a 
manual which is a tutorial on how to write 
computer machine code. The manual pro- 
vided is no exception. It is thorough, but 
not a complete explanation for those who 
have never written any machine code before. 
Many books abound on the subject. You 
may wish to use both another text of your 
choice and this system, if you are a beginner. 
Seventy-three pages long, the manual is 
reasonably complete. 1 must admit to a bias 
which says that manuals should be stan- 
dard 8'V X 11" size and in pica-size print. 
This one is smaller, but the print is readable. 

Both cassette and disk owners may use this 
assembler. I suspect most will turn to disk 
before long because it is more convenient, 
especially when storing various routines 
for later retrieval. 

The disk may be backed up. I recommend 
you do so, and use the original for backup 
and a copy for daily use. Never begin with- 
out some backup. Having no useable copy 
is no fun! By the way, the system assumes 
you use a single disk drive. (Some people, 
like myself, use dual drives through an 
interface to the C-64). 

Once loaded into the computer, you may 
work without loading other programs into 



the computer separately. A menu takes over 
this chore for you. 

This system offers you some excellent facili- 
ties to write code. Generally a person writ- 
ing any lengthy material will want to keep 
on file his/her "source file" which will pro- 
vide comments on what each routine is 
doing and by which the code may be changed 
or modified at a later date. The editor will 
permit one to load the code and change it 
at will. "Object Code" is awkward to work 
with as it must be disassembled to make 
sense. Changes in code produce an immedi- 
ate crash, most times. 

Among the handy dandy features are: con- 
version from binary to hexadecimal, hexa- 
decimal to decimal, and so on. The text 
editor allows one to add lines, delete lines 
and copy lines. A textfile may be loaded 
from and saved to both disk or tape. One 
may examine the disk directory, find a string 
in a file, replace a stringwith another string 
and list part or all of a file. 

A MEM command tells one how many bytes 
are used in a file, number of lines defined 
and the file name, if any, on disk. Disk 
commands may be sent to the disk from the 
editor. This is convenient. Listing thecode 
to the printer is easy. 

Strings may be replaced by other strings. 
This allows many occurrences of a single 
item to be replaced throughout the whole 
source code. 

The usual format is observed for assembly. 
A line begins with a label, if used, followed 
by the op code, address field and then 
comments, if any. Pseudo-codes are avail- 
able. Where a program is long, the com- 
puter may get files from disk by a CHN 
(chain) command. BYT allows the program- 
mer to insert numbers in decimal, hex, 
octal, or binary. Thissimplifies entry with- 
out looking up the binary values. 

Conditional code may be written using an 
IF. . . ELSE construct. You might want 
different code for, say, a 22, 40, or 80 col- 
umn machine. Another idea is EXP, which 
allows you to expand the parameters for a 
pseudo-op which may vary in different 
places. Equates are available to set fixed 
memory locations. 

One can list to the screen or printer during 
assembly; or neither, for faster operation. 
One may nest macros. This is a nice touch. 
Assembly may go to memory or disk. One 



need not worry if the same address is speci- 
fied for the code in memory as is occupied 
by the assembler. It writes somewhere else 
during assembly. I remember one system I 
once used. It wrote all over itself. Needless 
to say, this didn't work for long! 

Portions of memory may be reserved for 
later inclusion of a number of bytes by a 
command. One may wish to insert a special 
table somewhere at a later date. This func- 
tion then would be useful. 

ASCII data is generated from the ASCII 
letters directly, when between quotes in 
one command. This is terrific! Now you 
may write some clever words to the screen 
and not have to figure out the hex code for 
each number or letter. Let me see. . . P is 
$50 and R is ??? You just write it: 'PRINT 
YOUR NAME' and out comes the code! 
Very nice. Good thinking went into this 
assembler. I could get to like it very much. 

For dummies like me a handy command, 
WOR, allows me to place a two-byte hex 
code in the machine and it writes it out, low 
byte, high byte. SFFD2 then becomes D2 
FF in the order which the 6502 needs it. 
Not essential, but a nice touch. Incidentally, 
a comment may be added to a line by leav- 
ing a space after the code. No need to write 
a semi-colon. Good for lazy people. 

I am glad that I never make errors. My 
code is always perfect. Perfectly awful, that 
is! Errors are printed for everyone to see at 
the end of the assembly. MICOL SYSTEMS 
uses a two-pass assembler. This is usual for 
most assemblers I have used. The first pass 
writes l's on the screen, pass two writes 2's. 
A symbol table may print at the end, if 
desired together with the related addresses. 
These are very useful. All I know is that 
they save a lot of sweat. 

Source files are stored on disk, or tape, 
then called in when the assembler begins 
its job. After assembly you are informed of 
the total number of errors and the number 
of lines processed. 

A feature of this monitor, which is lacking 
in some, is the inclusion of a disassembler. 
This is neat to look at segments of code to 
see what is going on. I know some smarties 
read the hex code directly. But then I never 
claimed to be Frank N. Stein. As with the 
PET, you can load and save from this 
monitor. TRACE and SINGLE STEP are 



page 28 TPUC magazine 



both included. Code may be moved to 
another location as well. This includes a 
relocation facility. Most moves will crash 
without reworking them on relocation. 

Very handy is the next idea: To debug 
code, you can set break points. This stops 
the program where you wish so that you 
can try segments of code. In addition, you 
will see all registers, flags and counters 
when you "execute 1 ' this. Sometimes the 
flags are set such that some code will not 
run properly. Seeing the flags is an aid to 
sanity. 

I don't like the colour choice on the screen : 
this is the usual default value when the 
C-64 is turned on. I am sure this could be 
changed. I like a bit more contrast, myself. 

If you want to find text in some code, an 
inspect command allows you to look through 
the hex code and locate text; it is displayed 
as the character instead of the hex code! 
Sometimes looking for ASCII code can be 
a pill. This makes it easy to spot. 

Code may be run from the monitor. Make 
sure you have a file copy somewhere in 
case it crashes! I know someone that forgot 
this once. You will too. So save the code in 
a file first. 

My reaction to this assembler is positive: I 
like it. I understand the manual. A first- 
time user may flounder a bit, but the man- 
ual is clearly written in a forward manner. 
I once read a manual for an assembler. On 
page 38 it said: "now to begin." I begin on 
page one, myself. 

What I see as lacking in an otherwise excel- 
lent system is a short tutorial to get one 
started. A few practical examples of a typi- 
cal assembly would enhance the manual 
greatly, especially for beginners. The con- 
cept of a macro is hard for some to grasp. 
Macros are useful; one needs to get the 
hang of them. I think the remedy is to 
include a few print-outs of typical assem- 
bly code from a source file. This was not 
done. I hope future issues will include sev- 
eral examples. They could be included as 
files on the disk. The manual could men- 
tion them and tell how to get to them and 
execute the assembly. 

Again I highly recommend this product. It 
is sold by: Micol Systems, 100 Graydon Hall 
Drive, Suite 2301, Don Mills, Ontario, Canada 
MSA 3 A 9. 

Ask for their MACHINE LANGUAGE DE- 
VELOPMENT SYSTEM. For VIC 20 and 
C-64 -tape and disk. TPUG 



Supercharge Your 
Programmi 

Add far greater speed and versatility 
to your C64® or VIC-20® with Micol 
Systems' extraordinary new macro 
assembler package - System M2000 

Since machine language programs usually run 40-60 
times faster than their BASIC counterparts, this inexpensive 
package is like buying a more powerful computer at a fraction 
of the cost. A professional system that even the novice will 
find easy to use, it assembles kilobyte files in seconds and is 
one of the most powerful macro assemblers available. 

But it's more than just an assembler. Your programming will 
be simplified with such well designed programming tools as an 
Editor which has all the handy features allowing you to 
create your programs easily and a machine language 
Monitor, a sophisticated debugging tool and complete 
man to machine language interface. 

The package is 100% machine code and fully 
copyable for your convenience. Available on disk 
or cassette. 

Available at finer computer outlets. For the dealer 
nearest you call Toll Free 1-800-225-2774 (Capri Int'l 
in the U.S. and (416) 736-4402 (Access) or 
1-800-387-9758 (Softcom) in Canada. 

Micol Systems, 100 Graydon Hall Dr., 
Suite 2301, Don Mills, Ont. 
Canada M3A 3A9 




MICOL REPLIES 

We wish to thank Mr. Farquharson for his review 
of the Micol Systems' Machine Language Devel- 
opment System, Commodore 64 version. 

We, at Micol Systems, listen with great interest 
to feedback from our customers and critics. It is 
for this reason we have just released Version 2.0 
of the above-mentioned package. In keeping 
with Mr Farquharson s suggestions, we now 
include on the disk an example program which 
is lavishly commented. The user is invited to 
study, assemble and run this program to give 
him/her an even greater insight into the devel- 
opment of assembly language on the Commo- 
dore 64. 



In addition, it is now possible to change the 
colour combinations of the screen to any of 
fifteen colours the user might desire. 

These are only two of the many improvements 
we have included in version 2.0 for the Commo- 
dore 64 disk only. An excellent product is now 
even better Any purchaser of the original ver- 
sion may obtain Version 2.0 by sending us $10.00 
U.S. (SI 3.00 CAN) together with a copy of his 
receipt to our Canadian address. 



TPUG magazine page 29 



Commodore 64™ Interface 

Silicom Software is pleased to present, in conjunction with A.C. Concepts Inc. the following 

professional quality computer products. 




OCTOBUS T 



A PET IEEE GPIB interface for the Commodore 64* 

with these features: 

— plugs directly into the cartridge expansion port. 

— operates transparently with all software. 

— has a standard PET IEEE edge connector. 

— operates in basic 4.0. 

—comes with 2 full featured utilities:— a powerful 
machine language monitor— a flexible modem 
program 

— equipped with a switch which allows the user to 
transfer between the IEEE and Commodore* serial 
bus without affecting the computer's operation. 



Satisfaction guaranteed or money refunded. 
Both products come with a warranty against 
manufacturers defect. Discounts available for 
quantity orders. 



OCTOBUS PLUS 1 






Has all of the capabilities of the OCTOBUS plus these 
added features: 

— a Centronics parallel printer port. 

— includes a parallel printer cable. 

— an 8-bit DIP switch which allows the user to specify 
independently which devices are Commodore* serial, 
Commodore* IEEE, or Centronics parallel. 



To order send cheque, money order or Visa to: 
(Ontario residents add 7% P.S.T.) 

Silicom Software Inc. (416) 482-8136 
Box 47 P.O. Box 2213 Postal Station "P" 
Toronto, Ontario 
M5S 2T2 



^Commodore and Commodore 64 are registered trademarks of Commodore Business Machines, Inc. 



s 



ATTENTION PROGRAMMERS 



\ 



THE 

0© 



^ c 



A DIVISION OF PAHNKE & DUFFY INTERNATIONAL INC. 

IS LOOKING FOR NEW AND INNOVATIVE 
SOFTWARE FOR THE COMMODORE 64! 
IF YOU HAVE AN INTERESTING GAME OR 
USEFUL PROGRAM NEAR COMPLETION, 
COME TO US!! 

WELL HELP TO PUT ON THE FINISHING 
TOUCHES, PACKAGE, ADVERTISE AND 
DISTRIBUTE YOUR HARD WORK, WHETHER 
IT IS A NEW GAME, USEFUL UTILITY, 
OR A BUSINESS APPLICATION. 
YOU DO WHAT YOU DO BEST- 

*** PROGRAMMING *** 
WE DO WHAT WE DO BEST- 
GETTING YOUR PROGRAM ON THE MARKET- 
*** SELLING *** 

FOR MORE INFORMATION CALL US AT: 

(416)233-2259 

ASK FOR DEAN BROWN (CANADIAN MANAGER) 

THE SOFTWARE LAB 

5170 DUNDAS STREET WEST 

ISLINGTON, ONTARIO, M9A 1C4 



\ 



PROUDLY CANADIAN! 



/ 




THE SOFTWARE LAB 

PRESENTS THE 

DISK ASSISTANT 

A POWERFUL AND EASY TO USE UTILITY 

FOR INVESTIGATION AND MANIPULATION 

OF DATA ON YOUR C-64 DISK. 

THE DISK ASSISTANT SUPPORTS THE 

FOLLOWING FUNCTIONS: 

DISPLAYING: BAM 

DISK DIRECTORY 

SECTOR LINK 

SECTOR IN HEX OR ASCII FORM 

READING FROM AND WRITING TO THE DISK 

DISK FORMATTING 

ALLOCATING AND DE-ALLOCATING 

POWERFUL EDITING 

BUILT-IN QUICK COMMAND REFERENCE 

AND MANY MORE USEFUL COMMANDS! 

JUST $24.95 CAN./$19.95 US. 

VISA/MASTERCARD/MONEY ORDER 

PLEASE ALLOW 6-8 WEEKS DELIVERY 

ONT. RES. ADD7%PST 

THE SOFTWARE LAB* 
5170 DUNDAS STREET WEST 
ISLINGTON, ONTARIO, M9A 1C4 
PHONE (416) 233-2259 

PROUDLY CANADIAN! 

*ADfV. OF PAHNKE & DUFFY INT. INC. 




page 30 TPl/G magazine 



Menu Handling - Part II 



John Easton 

Toronto, ON 

To illustrate the concepts involved in menu creation, I am going to 
take a walk through a simple menu-driven program or two. For 
example, let's decide that we're planning to provide a variety of 
programs to a mixed public audience. Furthermore, our director 
wants some statistics, to back up the effectiveness of this demon- 
stration. For instance, he wants to know what age groups are 
interested in what programs, where these persons may be from and 
perhaps the background of their interest — all the stuff that statisti- 
cal reports are made of. The following program excerpts are from 
various programs demonstrated at the Annual TPUG Conference 
in illustration of the use of menus and statistical tracking of such 
use. I believe that programs similar to these are available on a 
Speakers' Disk — only the line numbers have been changed to pro- 
tect the innocent. 

BOOT 

Let's start with a basic BOOT program. Regardless of where you 
might like to go in the demo stuff, should you be required to keep 
statistics, it will be necessary to clean up an area in memory to store 
such statistical stuff — thus the BOOT program. This program 
(traditionally the first one on the disk) checks to see what machine 
we're currently running (basic to any BOOT program) and then in 
this case prepares a Statistical Notepad in a convenient cassette 
buffer. Finally, it asks for the statistical background material requested 
by our statistics department. 

On completion of its tasks it then conveniently loads the Main 
Menu for us, and things proceed merrily from there till (hopefully) 
our satiated user says he's had enough — at which time our Main 
Menu program saves these important statistics to disk and we 
arrive back at the BOOT to wipe the slate clean and start again. I 
say hopefully because it is our experience that most casual passers-by 
will hit a key or two, maybe select something from the menu — but 
invariably, when they've had enough, will merely walk away, 
leaving a rather cryptic message for the next user — PLEASE SELECT 
YOUR CHOICE ARNOLD! A timing loop to intercept a pre- 
determined time of null response (indicating that Arnold has gone 
for coffee) I leave to you. Such a loop should be capable of closing 
everything down in the Statistics department, as far as Arnold is 
concerned, and returning to the BOOT to await the next happy 
customer. 

Rather than reproduce a tedious listing of typical menus, why 
don't I just point out various conventions and aids that we've come 
across over the years to make this chore a little less formidable? For 
actual examples of programs, I would suggest you refer to the 
Speakers' Disk for the May Conference — I believe most of the 
example menu formats are reproduced there for your use and 
adaptation. 

So let's just pick up some of the program lines as we go — and I'll 
explain them as we walk through a typical program: 

10CL$ = CHR$(147): 






It's usually a good idea to clear the screen before inflicting strange 
Upper/Lower Case And/Or Graphics Modes upon your unsuspecting 
user. I prefer to define it in this manner because it's more obvious 
to some stranger who might be attempting to translate your CBM 
BASIC to run in his TRS or Apple. CL$, for instance, looks very 
similar to the command CLS in TRS BASIC — and will now oper- 
ate in a similar manner. The equivalent in Applese is CALL -936: 
but then, we all have to put up with some inconvenience. 

15 POKE 50003,64:C = PEEK(50003):IF C=64 then 80: 

Establish machine version by POKEing to an area that is ROM in 
anything but a C-64. If the POKE 'takes' it must be a C-64. Incidentally, 
this particular PEEK will also tell you which ROM version on the 
GREEN MACHINE you may be working with: 

IF C=0 THEN ROM = l, IF C=l THEN ROM=2, IF C = 160 

THENROM = 4 

35 IF PEEK(213) = 39 THEN 55: 

Check for 80-column machine (an 80-column screen will return a 

value of 79) 

40 PRINT CL$;"(8 cursor-down)", "(reverse) Please re-load 

after I have changed screens n 

45 LOAD "CBM *",8 

Load Chuan Chee's Screen Scrunch program to force a 40-column 

screen, after which the simplest thing is to re-start the program, 

and since we now have 40 columns, the program will skip this 

portion of the program. 

GREEN MACHINE SETUP 

55 PRINT CL$:POKE 59468,14 
Clear screen and set upper/lower case 

60 POKE 42,0:POKE 43,41:CLR: 

Set END-OF-BASIC pointers higher than any of the following 
programs. This, in effect, will allow program chaining and parame- 
ter passing since, from this point onward, your machine will think 
it is running the same program (the largest one on the menu) 

61 C = PEEK(50003): 
Re-set 'C after clear 

65 IFC = 160 THEN KEY=144:EN=85:DI=85+3:POKE KEY,DI: 
Disable stop-key for ROM 4.0 

66 EX = 64721 :IF C = 160 THEN EX = 64790 : 

Breakout and machine re-set (ROM 2.0 &: 4.0) — note this is just a 
way out so that, when necessary, you can break out of the program, 
even though you've bulletproofed it thoroughly. 

67 GOTO 110 (skip the C-64 stuff) 

C-64 SETUP 

80 PRINT CL$:PRINT CHR$(14) 
Clear screen and set upper/lower case 

81 PRINT CHR$(5):POKE 53280,6 

Set white characters on blue background — the simplest C-64 text 
format in my rather limited C-64 experience. 

85 POKE 45,0:POKE 46,45:CLR: 

Set END-OF-BASIC pointers high - you will note that this POKE 
(to location 46) is 4, or a value of 1024 (4*256) higher than the 
equivalent POKE in a GREEN machine — and that's the difference 
in the location of your BASIC programs. 



TPUG magazine page 31 



90 C = PEEK(50003): 

Rc-sct l C' after clear 

95 KEY = 788:EN = 49:DI = EN+3:POKE KEY,DI:PRINT 

CHRS(8}:EX = 64738: 

Disable stop and reset keys and establish breakout location. 

110 FOR I = 834 TO 907:POKE I,0:NEXT 

If you're attempting" to keep statistics, here's where you clear a 
bunch of "pigeonholes" sufficient in number to track all the data in 
which you might be interested for the next pass through the programs. 
This space is in a cassette buffer and since we're not planning to use 
cassette, it's a handy spot for our "memo pad". Make sure that any 
such location doesn't interfere with any fancy stuff that might be 
included in following programs. (Editors Note: In PET/CBM 's, using 
this part of the second cassette buffer is incompatible with use of BASIC 4.0 
disk commands). The safest buffer for CBM owners would be in the 
'First Cassette Buffer', with starting address of 634. Maximum 
bytes in this casette buffer is 192. 

Now we set up a few housekeeping-type variables to allow us 
simpler code routines in the subsequent programs. You will note 
that those defined variables we wish to preserve are concatenated 
with a null ("") to force them into upper memory, away from the 
destructive influence of program overlays. 



(39 spaces) 
( 39 half — graphic key ) 









120 BL$ = u 

125 LNS = " 

CHR$(249) or similar 

130 SB$ = "(rvs) Press Space-Bar to Continue 

135 RK$ = "(rvs) Press 'RETURN' Key when finished 

All these 'prompt-type' messages are set to 39 characters to bypass 

any possible line-wrap problems. 

140 IF C = 160 THEN BEL$ = CHR$(7) 

Ring bell on CBM machines used as a prompt (usually to signal 

incorrect input). I'll leave the equivalent C-64 routine to you C-64 

experts. 

And finally, we'll set up vertical tabs in a manner similar to that 
found on the Apple — greatly simplifies screen formatting and 
prompt locations. 

145 VT$ = "(home + 23 cursor-down)" 

150 DIM VT$(24) 

155 FOR I = 1 TO 24 : VTS(I) = LEFT$(VT$,I) : NEXT 

Your VT$() variables will automatically build into upper memory. 

OK — now that we've set up things, we might as well slick our 
simple subroutines right near the beginning of each program. 
NOTE : don't forget to bypass them in the main body of your 
program with a line like: 

160 GOTO 1000 

continued on next page 




Software for Commodore-64 



COMPLETE EDfTOPtASSEMBLCM 
PACKAGE FOH YOUH 94 



ASTRO POSITIONS 
display and print the position of the 
sun and stars (one ire second accu- 
racy) and the position of the moon 
and the planets (one arc minute accu- 
racy except for Pluto) for any date 
in history 

includes Users Guide. Introduction 
to Positional Astronomy and Intro- 
duction to Classical Astrology. 

DISK 39.95 




:DIT/ASM II 



- DESIGNED TO HELP YOU CREATE 
AND MODIFY 6502 Assembly Lan- 
guage Programs on the Commodore 
64 Computer. 

ON SCREEN HELPSYSTEM to assist 
you in using all commands available 
add. assemble, calculate. delete. direc- 
tory, disk, edit, find. help, insert, list 
load, merge, new. plist. quit, and save. 

DISK 28.95 



DAISY 

DAtabase information SYstem 
one of- the comprehensive DATA- 
BASE SYSTEMS for rhe 64 
fully bilingual on screen 
calculates, compute the contents of 
numeric fields-add. subtract, mul- 
tiply or divide against the defined 
field usmg either constant value of 
the contents of any other field in the 
record. Virtual disk operation. 

DISK 39.95 



Powerful household finance — 
Business system 

eliminate inconvenient files confus- 
ing tables and tedious calculations 
store all your data on WORDS J. 
CALCS spreadsheet 
WORDS &CALCS will do your worx 
for you in organizing, displaying 
storing, printing and performing 
calculations 

DISK 33 °5 



YES ! You CAN get quality software 

at a reasonalbe price. 

Write for our FREE catalog. 

Money Order, Check, Visa or Mastercard. Dealer and distributor inquiries invited. 




Suite 210, 

5950 Cote des neiges 

Montreal, Quebec H3S 1 Z6 

Canada 



page 32 TPUG magazine 



We always need a simple GET or two - 

************* Yes/No ************** 

200 GET R$:IF fl$ > " " THEN 200 

210 GET 1=1$: IF R$ = "V" THEN RETURN 

220 IF fl$ O "N" THEN PRINT BEL$:FOR 1=1 TO 100 :NEXT :G0T0 210 

230 RETURN 



*********** Space-bar ************* 

300 PRINT VT$<24>;SB*; 

310 GET R$:IF R* > " " THEN 300 

329 GET R$:IF R$ = CHR$<216> THEN SVS EX 

#** Note - a simple way to break out with a. SHIFT/X character 

330 IF R$ O CHR*<32> THEN PRINT BEL$:FQR 1=1 TO 180 : NEXT : GOTO 
340 PRINT VT*C24.->;BL$; 

350 RETURN 



320 



** Double-Get (any number to 99? ** 

400 GET R$:IF R* > " " THEN 400 

410 GET R$:IF R$ = "" THEN 418 

420 IF R$ = "0" THEN RETURN 

*** note 420 allows for the convention o-F '0' to exit 

430 R = VflL<fl*>:IF R < 1 OR R > 9 THEN PRINT BEL*:G0T0 410 

*** note if input is to be limited to a maximum of say 15 

then add the following optional intercept line. 

to acknowledge only the possibility of one 'ten'" value. 

435 IF R > 1 THEN RETURN 

440 FOR I = 1 TO 600 : NEXT 

450 GET R$:IF R* = " " THEN RETURN 

460 R = <fl#10> + VflL<fl*> 

470 RETURN 



****** Rlpha STRING input ******* 

Note pr i or- to -access i ng this subr out i ne , it is presumed that you have pr i nted a 
prompt at the bottom of the screen such as PRINT VT$<24>;RK*; - and further to 
that, since this routine echoes your input by printing to the screen.- you will 
ha^e returned the cursor to your current position on the screen by means of the 
VT*< > arid TRBC 3 functions. 






500 R*="" 

510 GET RR$:IF RR* > " " THEN 510 

520 GET RR$:IF RR* = "" THEN 520 

530 IF RR$ = CHR^'T.IS^ THEN PRINT VT*C24} ;BL$; : RETURN 

540 IF RR$ = CHR$<20> AND R* = " " THEN PRINT BEL*:GQT0 520 

550 IF RR* = CHR*<:28? THEN PRINT " Ccursor- lef t blank cursor- left] " 

R$ = LEFT^R* , LEN<fl*>-l> :G0T0 520 

560 IF RSC'.'.RR*.^ < 65 OR RSGCflR*? > 90 THEN PRINT BEL*:G0T0 520 

570 PRINT RR*; 

580 R$ = R$ + RR$:G0T0 520 
























Note prior to accessing this subroutine, it is presumed that you 
have printed a prompt at the bottom of the screen such as PRINT 
VT"*(24);RK$; — and further to that, since this routine echoes your 
input by printing to the screen, you will have returned the cursor 
to your current position on the screen by means of the VT$( ) and 
TAli( ) functions. 

A FEW THOUGHTS IN PASSING: 

The previous small subroutines are by no means to be taken as the 
final word in programming techniques. On the contrary, as every- 
one has his own style, merely build on this and compile your own 
library of simple routines. Each of the above routines could bor- 
row from others — for instance, you may or may not prefer to print 
your input to the screen as it comes in: you may or may not prefer 
to ring the bell on incorrect input (a flashing prompt may be more 
effective in your estimation, or both). Some common ideas, though, 
that you should be aware of include the 'keyboard buffer clear' as 
exemplified, for instance, in line 510. Such a procedure assures us 



that the input expected at least should somewhat resemble what we 
get — otherwise, there is no telling how many times the keyboard 
may have been inadvertently leaned upon during the previous 
course of your fantastic program. 

Also, any prompts printing to the bottom line are best held there 
with a terminating semi-colon, else the screen may tend to scroll 
up one line — and remember, any subsequent returns to the screen 
must allow for cursor re-positioning. 

There are two common ways to check for valid input — the VAL( ) 
or the ASC{ ) functions. VAL(A$) on line 430 will return the 
numeric value only if the input was numeric — the VALue of other 
characters is 0. An optional numeric input check might read as 
follows : A = ASC(A$)-48 : IF A < OR A > 9 THEN ..(error). 
Similar ASCII value 'filters' may be employed to check for any 
specific character, or range of characters. TPUG 

To Be Continued. . . 



TPUG magazine page 33 



THE WAIT 
IS OVER 



The Commodore 64™ COMAL 2.0 Cartridge 
is being produced for Nov 84 delivery. 

• Full 64K ROM Cartridge— 30K Free User Memory 

• Empty socket for user EPROM (8K, 16K or 32K) 

• LOCO' compatible turtle graphics (with abbreviations) 

• Easy Sprite ANIMATION— Load, Save, Link Shapes 

• interrupt driven Music— Full control of SID 

• user definable fonts— Load, Save, Link Fonts 

• Three different screen dumps in: 

Hi-Res Graphics, Multi-color Graphics, Text 

• Error Handler, External Procedures, Trace commands 

• Protected input, Batch command File Capability 

• Easily definable Function Keys 

(i.e., F7 will RUN any program from a directory) 

• Built in LINK command for Machine Code Routines 

• HEX and BINARY accepted— ASCII conversion built in 

All prepaid advance orders receive free: 

• comal handbook, Second Edition (includes cartridge) 

• introduction to 2.0 Built in Packages Book 

(Graphics, Turtle, Sprites, Sound, Font, . . .) 

• TWO different demo disks (1541 format) 

• White custom molded case for disks and book 

ALL FOR ONLY $99.95 

(A S175 value— nearly half price) 

Due to high demand orders will be filled on first come basis. 
Send check or Money Order in US Dollars plus S3 handling to.- 

COMAL USERS CROUP, U.S.A., LIMITED 

5501 Croveland Ten, Madison, Wf 53716 
phone: (608) 222-4432 

visa and MC prepaid orders may call toll free: 1-800-356-5324 
extension 1307 

Commodore 64 Is a trademark of Commodore Electronics Ltd 



NEW FOR HIGH SCHOOL 
ADMINISTRATORS 

IF A STUDENT WANTS TO 
CHANGE HIS TIMETABLE . . 
CAN YOU DO IT? 



s es 



>(0^ 



c^- 




The WYCOR Class Scheduling 
System lets you: 



Add new students, change existing timetables. 

Checks all available classes, class sizes. 

Displays 32 best timetables that minimize class sizes. 

Lets YOU pick the timetable. 

Prints the new timetable. 

Updates class size. 

Prepares a teachers change list. 

Other reports avaliable. 



52 



WYCOR BUSINESS SYSTEMS 

170 The Donway West, Suite 401 
Toronto, Canada M3C 2G3 
Tel. (416) 444-3492 



IF IT'S FOR 
AND IT'S C 



THE COMMODORE 64 
iOOD, IT'S PROBABLY 




MANAGEMENT SYSTEM 64 

This integrated business program gives you the computer, power 
once reserved for large corporations. Capabilities include invoicing, 
inventory control, and customer mailing lists. Disk $69.95 

FINANCE CALC 64 

The leader in home and business financial analysis. You can have up 
to 1 440 itemized expenses and print 1 085 different financial reports 
and bar graphs. In addition, it keeps and compares as many as 12 
budgets at once. Disk $ 49.95 

DATA BASE 64 

A perfect record system for any business or home. It can store up to 
1 200 records and has up to 20 fields for each one. A special label and 
report designer is included. It can also merge with popular word 
processors. Disk $59.95 

GAME DESIGNER 64 

Use to animate 16 sprites and design colorful background screens. 
Several game sub-routines included. Disk $39.95 



STUDIO 64 

Anyone can now create music as beautiful as the most advanced 
programers could one year ago!! Just play and the computer will 
instantly write the music on the screen. Included are powerful fea- 
tures like plock move, single note editing and scrolling. It is the only 
music synthesis program that allows you to make each note a different 
waveform sound and octave. Add music to your own programs with 
the Add Mus'ln adaptor. Disk $39.95 

FAMILY PAK (3 IN 1) (ALL) $55.95 

Three of the finest home programs available: 
CHECKBOOK EASE 64 

Handles over 1300 transactions. Prints statements, and all types of 
checks, and 40 expense categories. $39.95 

RECIPE FINDER 

Searches by ingredient, category or name. Calculates measurements 
for different serving amounts and prints copies. $29.95 

SPACE MATH 64 

Learn math, explore the universe, dance to the music and watch the 
show with the only educational game that talks in an actual human 
voice. $39.95 



EXCLUSIVE CANADIAN DISTRIBUTORS- -S & <zR SntsxtlXJ 



Add $2.00 for shipping & handling 
Ontario residents add 7% sales tax. 



• PEFFERLAW. ONT. - LOE 1 NO 

CANADIAN DEALERS INQUIRIES INVITED. 



CANADA - (705) 437-3^?. 



NOTE; PROGRAMS ARE COMPATIBLE WITH ALL PRINTERS AND UTILIZE FULL-SCREEN PROCESSING. 



PRICES IN U.S. FUNDS 



SAVE BIG ON COMPUTER PRODUCTS 



page 34 TPUG magazine 



TPUG COMAL COURSE - Part HI 

Borge Christensen 

Tonder, Denmark 

In Parts I and II of this series (TPUG Magazine, July and August September 1984) Mr. Christensen discussed COMAL procedures, 
variable-passing, recursion and conditional looping. In this article, he explores methods of branching . 

5. HOW TO FIGURE OUT A STRING. 

Clear the workspace and the screen and enter this function: 



0010 


FUNIC VALUE <T$> 


0020 


IMUM:=0 


0030 


FOR C:=l TO 8 DO 


0040 


IF T^CrO^'l" THEN 


O050 


BIT:=1 


O060 


ELSE 


0070 


BIT:=0 


0080 


END IF 


0090 


NUM:+NUM+BIT 


0100 


ENDFQR C 


01.10 


RETURN NUM 


0120 


ENDFUNC VALUE 


0130 


// 



Type RUN and enter this command: 

PRINT VALUE("00001000") 

Note the number returned by the function. Then try these commands one by one: 

;VALUEC000011H") 
;VALUE("10000000") 
;VALUE("11111111") 

The character ";" may replace the keyword PRINT. I think you have figured out what the function is doing. In any case this is how 
it operates: 



PRINT VALUE{"000011H") 

/ 

FUNCVALUE(TJ) 



NUM:=0 

F0RC: = 1T0 8D0 

IFT$(C:C)-T'THEN 

BIT: = 1 
ELSE 

BIT:=0 
ENDIF 

NUM.- + NUM + BIT 
FNDFOR C 
RETURN NUM 

ENDFUNC VALUE 



The function is called; i.e. you 
ask for a number to be returned 
and printed out. 

The string "00001111" is passed 
as a value to the formal 
parameter T$. 

A value of is assigned to NUM 

The string held by T$ is scanned 
character by character, and 
if the C'th character is a 'T 1 
BIT is assigned a value of 1, 
but if it is anything else 
BIT is assigned a value of 0. 

The present value of NUM is 
doubled and BIT is added to it, 
thus the binary equivalent of 
T$ is accumulated in NUM 
whose value is returned to be 
used in the calling statement 
in the place of function. 

End of definition of VALUE. 



continued overleaf 



TPUG magazine page 35 



One of the statements in the FOR loop may need a little more attention: 

1FT$(C:C)= ( T'THEN 

The expression T$(C:C) returns a one character substring of TS, i.e. simply the C'th character of T$. K this character is equal to "I", 
the Boolean expression in the IF statement comes out TRUE; otherwise it comes out FALSE. We shall have more to say about 
substrings later in this article. 

In COMAL the truth value TRUE is represented as a numerical I, and the truth value FALSE is represented as a numerical 0. This 
fact can be utilized to simplify the function VALUE. 

Remove the lines 40-80 by using the command: 

DEL 40-80 
and insert this one: 

40BIT: = (T$(C:C)='T') 
Type the command RENUM (don't forget to press <RETURN>) and then LIST to see the following on the screen: 

OOIO FUNC VALUE (T*) 

0020 NUM:=0 

0C30 FOR C:=l TO 8 DO 

004O BIT: = <T*<C:C>= n l " ) 

0050 NUM: +NUM+BIT 

0060 ENDFOR C 

0070 RETURN NUM 

0080 ENDFUNC VALUE 

0090 // 

Note how the lines have been renumbered to become orderly sequenced. Type RUN and then use some calling commands like the 
ones given above to test the function's working. 

Since it is only tested whether an individual character is a "1" or not, other patterns than those applied before may be used. Try 
commands like this: 

;VALUE( u ABCDllir') 
or simply 

;VALUE(" 11 11") There are four blanks in the string 
and note the results. Then change line 40 to become: 

BIT: = (T$(C:C)="X") 
Type RUN and try this command: 

PRINT VALUE(" XXXX 1 ') There are four leading blanks. 

Then try some of your own. What is the printout from this one: 

PRINT VALUEC'TXPXUXGX") 

It is an important fact that patterns can be evaluated in different ways. We are going to used this extensively in the following. 

Important note. In revision 0.14 if an error occurs during a direct mode call of a function or a procedure, the prepass is injured. 
Therefore in such case you have to restore the internal states by applying the RUN command before you can use the function or 
procedure again. In revision 2.00 the prepass state recovers automatically after a runtime error. 

As you may know already, a number written in eight bits — binary digits— is called a byte. So VALUE simply converts a string 
that represents a byte into a decimal number. 



page 36 TPifQ magazine 



Enter the command 

AUTO 100 
and add this procedure to the one already in workspace: 

OlOO PROC INTERPRET (LINE*) 

0110 FOR I:=l TO 3 DO 

0120 BYTE: =VALUE (LINE* (1*8-7: 1*8) ) 

0130 PRINT BYTE; 

0140 ENDFOR I 

0150 PRINT 

0160 ENDPROC INTERPRET 

0170 // 

Type RUN and enter these commands (don't forget <RETURN> after each: 

INTERPRETf'XXXX XXXXXXXX XXXX") 24 chars, in all 

INTERPRET^ 1 XXXX XXXXXXXXXX XXXX ") 
INTERPRETS XXXXXXXXXXXXXXXXXXXX ") 

Each string may be looked upon as a representation of three bytes; each "X" being a "1" and each blank being a "0". And each call 
returns 3 decimal numbers, one for each byte. 

Here is how INTERPRET works: 



INTERPRETfXXXX XXXXXXXX XXXX") 

PROC INTERPRET(LINES) 

FOR I: = l TO 3 DO 

BYTE: = VALUE(LINE$(I*8-7:I*8)) 

PRINT BYTE; 
ENDFOR I 
PRINT 
ENDPROC INTERPRET 

Let us take a closer look at this line: 

BYTE: = VALUE(LINE$(I*8-7:I*9) 

If I is equal to 1, the substring LI NE$( 1:8) is pointed out, which means the first eight characters of the string that has been assigned to 
LINES. This eight-character string is taken to VALUE for evaluation, and the result is assigned to BYTE. Next the substring 
LINE$(9:16) is picked up, and finally the substring LINE$(17:24) for similar processing. 

What do you get out of this command: 

INTERPRETCEXTRA FOR YOUR NEXT XMAS") 

Try to make an answer without using the computer; then compare with an actual run. 

Change line 130-150 of INTERPRET and add some lines to the program to get: 



The string constant is 

passed as a value to the 
parameter LINES, and the 
value of LINES is then 

divided in three substrings 
each of which is passed on 
to VALUE. The numerical value 
returned is assigned to BYTE 

and this BYTE is displayed. 

A linefeed follows, 
and all is done. 



0010 FUNC VALUE (T*) 

0020 NUM:=0 

0030 FOR C:=l TO 8 DO* 

0040 BIT: = (T* (C; C) =" X" ) 

0050 NUM : +NUM+B I T 

0060 ENDFOR C 

0070 RETURN NUM 

OOSO ENDFUNC VALUE 

0090 // 



0100 PROC INTERPRET (LINES) 

0110 FOR I:=l TO 3 DO 

0120 BYTE: =VALUE (LINE* < 1*8-7: 1*8) ) 

0130 PRINT USING " ###": BYTE 

1 40 VALUE * OF * TPUG : +BYTE 

0150 ENDFOR I 

0160 ENDPROC INTERPRET 

0170 // 



continued overleaf 



TPUG magazine page 37 



0180 


DIM THISLINE* OF 24 




0190 


// 




0200 


VALUE' OF' TPUG: =0 




0210 


REPEAT 




0220 


READ THISLINE* 




0230 


INTERPRET (THISLINE*) 


0240 


UNTIL EOD 




0250 


PRINT " " 




0260 


PRINT USING "tttttttttt": 


VALUE' OF' TPUG 


0270 


// 




0280 


DATA "XXXXX XXXXX X 


X XXX 


0290 


DATA "X X XX 


XX X " 


0300 


DATA "X X XX 


XX 


0310 


DATA " X XXXXX X 


XX XX " 


0320 


DATA "XX X 


XX X " 


0330 


DATA "XX XXX XXX " 


It is up to you to find out what currency is used, bi 


it I can inform you that EOD means "End Of Data". It is a Boolean function that 


returns a value of TRUE when the last item in a data queue has been read. The statement 


DIMTHISLINESOF24 




declares THISLINES such that it can have a string assigned to it of 24 characters at most. Strings must always be declared in revision 


0.14. In revision 2.00 simple strings need no declaration. TPUG fa Be Continued. 









=[] 



COMMODORE VIC 20 GAMES 

Exciting new games . . . 

Clearance SALE up to 75% off LIST PRICE 



Ik 



NUFEKKOPGAMES, with GREAT SOUND, ACTION, 

COLOUR, GRAPHICS. Exciting games top notch values 

even at list price, great for alf ages, from 5 to 75. All 

Cassettes. . . FOR VIC 20 no extra memory needed. 

IMMEDIATE DELIVERY. ,. 

List Discount 

Price Price 



ALIEN PANIC 
ANTIMATTER SPLATTER 
EXTERMINATOR 
KRAZY KONG 
RACEFUN 
MUSIC WRITER III 
THE CATCH 
KINGS RANSOM 
TOTAL LIST PRICE 



$24.95 $6.95 

$29.95 $7.95 

$39.95 $9.95 

$24.95 $6.95 

$24.95 $6.95 

$39.95 $9.95 

$29.95 $7.95 

$39.95 $9.95 

$254.60... SALE $66.60 



TOTAL PRICE save nearly $200.00 

PLEASE ADD $2.50 for shipping and handling for first 
game and $1 , for each game thereafter. 

WANTTOSAVEEVENMORE?ORDERTHEWHOLE 
LOT!!! WE PAY THE SHIPPING TOTAL $66.60 plus 
7% Provincial Sales Tax for Ontario Residents 



EXTRA MEMORY 
MAKER NUFEKOP 



VIC GAMES BY THE SAME 

List Discount 

Price Price 

DEFENDER ON TRI $29.95 $7.95 

3D MAN $29.95 $7.95 

SPACE QUEST $29.95 $7.95 

Total List Price $89.95 Discount Price $23.85 



FREE SHIPPING IF YOU ORDER ALLTHREEGAMES 
OR add $2.50 for shipping and handling for first game 
$1.00 thereafter. 

8K MEMORY EXPANDER FOR VIC 20 

VIC 20 8K MEMORY EXPANDER STANDARD PLUG 
IN CARTRIDGE INCREASES MEMORY from 5,120 
bytes to 13,312 bytes. GOLD PLATED CONTACTS. 
ONE YEAR WARRANTY PREMIUM GRADE COM- 
PONENTS. COMPLETE DOCUMENTATION. 

REGULAR PRICE $59.95 
Special SALE PRICE $45.95 
YOUR SAVINGS$14.00 

ONTARIO RESIDENTS ADD 7% Provincial Sales Tax 

($3.85) 

Handling and shipping charges Add $5.00 

MASTERCARD, VISA, MONEY ORDERS, PERSONAL 

CHECKS TAKE THREE WEEKS TO CLEAR. PHONE 

ORDERS ACCEPTED (we deduct $1 for cost of call). 

PHONE (705)437-3187 or WRITE B & R ENTER- 
PRISES INC., PEFFERLAW,ONT. LOE 1N0 

FREE MONEY SAVING CATALOG WITH EVERY 
ORDER. 

CALL (705)437-3187 PHONE ORDERS AC- 
CEPTED 9 AM TO 10 PM MON.-SAT. CALL 
(705)437-3187 DEALER INQUIRIES INVITED 



page 38 TPUG magazine 



Integral Adventure Game 



Brad Bjorndahl 

Bramalea, ON 

Editor's Note: This article describes a use for a computer as a tool for 
intellectual exploration. The "game" to which it refers is of a very aca- 
demic nature. 

The numerical adventure that I will describe here is one which has 
no ending, can take any direction which your imagination can find 
and has infinite and very real rewards for the resolute. 

Each pathway is well-defined and can only be followed with an 
open mind and clear-headed reason. A familiarity with previous 
terrain speeds adventurers forward and will help them to recog- 
nize invalid routes and rewards which disappear on close examina- 
tion. Often more than one path leads to the same reward and one 
path can diverge at the end to multiple rewards. This adventure 
becomes richer the farther it is travelled and so becomes corre- 
spondingly more difficult. 

This article will provide a starting point, some references of those 
who have written of their own adventures and suggestions on how 
to use your computer for exploration and experimentation. 

This adventure is integral in the sense that all versions of the game 
are parts of a whole and each version is simply a different starting 
point. This adventure is also integral in the sense that it uses 
integers. Professional integral adventure players call their game 
Number Theory but we amateurs intend to enjoy ourselves and 
will call it an Adventure, which is a far more accurate designation. 

The starting point described here is relatively new, discovered 
sometime within the last half century. A fine introduction to this 
version of the Integral Adventure is found in reference 3. Briefly, 
the adventurer chooses any positive integer. If it is even, divide by 
2; otherwise multiply by 3 and add I. So simple! Now you have a 
new number, either greater or smaller than the first. If it happens 
to be equal to 1, then stop; otherwise repeat the even/odd test. 
Continue this way to get a sequence of numbers which may or may 
not end (at 1). Let's try 5, which is odd. The next number is 5*3+1 
= 16. This is even so 16/2 = 8 is next. Again even so 8/2 — 4 is next. 
4/2 = 2 and 2/2 = 1 to end the sequence. Try a few numbers for 
yourself but start small. If you experiment with 27 you will find out 
why reference 3 calls these hailstone numbers. 

Before we start exploring we should, as good adventurers, do a 
little thinking. A simple observation shows that any power of 2 will 
be continually divided by 2 until 1 remains. Also, you may have 
noticed that all your experiments have ended on a 4,2,1 sequence. 
You may have also observed that the 4,2,1 sequence is a loop since 
the sequence formula applied to the number I yields 4. Which 
starting numbers end up in the loop? At least as many as you have 
tried and all powers of 2. Are there any more loops, that is, any 
numbers which lead to themselves? Why are some sequences long, 
such as the one that starts with 27 which has length 111. Where is 
the pattern in the sequences? Surely all integer sequences have 
patterns. There are many more questions to ask, but exploring a 
little now may shed some light. Try writing a program which will 
accept a starting value (e.g. 27) and apply the formula until the 
sequence hits 1 and will at the same time count the length of the 
sequence. This is not difficult, and you can check your results with 
reference 3. This is just an exercise, though, because all numbers 



up to 2 to the exponent 40 have been checked (in Japan) and they 
all end up 4,2,1. Does this mean all sequences end? Perhaps (2 to 
exponent 40)+I ends in a different loop or does not end at all: i.e. 
continues climbing to infinity. A more difficult program to write 
will search for and record new loops. This program is useful for 
exploring sequences which are generated by adding a value other 
than 1 to odd numbers, that is, 3*N + C where C must be an odd 
number (why?). For C = 3 you will immediately find the loop 12,6,3 
and for C=5 two loops: 20,10,5 and 4,2,1 again. 

There are more loops for C = 5 but they are difficult to find without 
a computer. I have found 6 different loops after looking at starting 
values up to 500. Two of the loops are 44 numbers in length so your 
program which searches for loops must be generous in storing long 
numeric vectors. APL on the SuperPET allows arrays to be dynami- 
cally dimensioned to avoid this problem of overflow. APL is an 
ideal tool with which to play these numbers games but it is not fast. 
I expect that BASIC with a simple machine language routine to 
check for parity (i.e. the even/odd condition) and to do the arithme- 
tic would be much faster but of course not as flexible as APL. 

There are a few more small points before you continue on your 
way. First, use the number C to prove that there is always at least 
one loop. Second, be aware that this version of the Integral Adven- 
ture is relatively unexplored. Since there is little helpoutside your 
own skull it is both more exciting and more difficult. Lastly, for 
reasons described in reference 3, I call this version the Hailstone 
Adventure. For those interested in other versions, I can suggest 
the Prime Number Adventure and, my favorite, the Fibonacci 
Adventure. Enjoy the game. TPUC 

References: 

Beiler, Albert H. Recreations in the Theory of Numbers, 
2nd ed. New York: Dover Publications, l%6. 

Grosswald, Emii Topics from the The or v of Numbers. 
New York: The MacmiUan Company, 1966. 

Ha yes, Brian. "Computer Recreations",Scien tific A me rica it, 
January 1984, pp. 10-16. 



^1 •! 



COOL YOUR DISC DRIVE 

with the "F2500" cooling fan for your 
Commodore 1540/1541 disc drive 

Protect your valuable programs from 
excessive heat buildup 

A must for every disc drive owner 

• Powerful fan cools critical components • Helps prevent disc & 
drive problems due to excessive heat buildup • Quiet operation 

• High volume air output • Low profile • Easy installation- no tools 
required • 90-day free replacement warranty • only $54.95 U.S. 
($69.95 Can). *B.C. residents add 7% sales tax. 

1540 and 1541 are registered trademarks of Commodore Business Machines Inc. 

To order your F2500 disc drive cooling fan please send your 
cheque or money order for $54.95 plus $2 for shipping to: 

Besco Products 
203-8060 Granville Ave., Richmond, B.C. Canada V6Y 1P4 
Telephone (604) 278-5115 DEALER INQUIRIES INVITED 



TPUC maoi^inc page 39 



AT BLACKJACK THE PLAYER, IF HE PLAYS RIGHT, IS EXPECTED TO WIN IN THE LONG RUN ! ! 



^ 



FOR THE COMMODORE 64 




The Ultimate Blackjack game 
COMPLETE WITH SUPER GRAPHICS AND SOUND EFFECTS 



WORLD CLASS CASINO 
BLACKJACK 



$49.95 



\ 



^TTTTTTTTTTTTTffTfff?^ 



Master the skill and self-control needed to play winning blackjack. Learn the most effective yet the simplest "card 
counting" system, which is used by the world's most successful international blackjack players. You can simulate the rules 
of the best casinos around the world where you ought to be playing and winning. Play one hand against the dealer and learn 
the basic strategy using the "card count" system, or play up to seven hands and see how well you can play under real casino 
conditions. 

Playing one hand: the computer works the "card count", displays the basic strategy, all cards left in the shoe, each card's 
chance of being drawn, the percentage chance of going bust, and keeps track of all bets. By choosing different dealing 
speeds, you can progressively improve your"card count" until you can keep up with the fastest dealers. You can also get a 
summary of your game at any time during play. 

BONUS — Included is a separate 37K M/L program that lets up to 7 different players play blackjack against the Casino at the 
same time making the game as close as possible to the real thing. 

World Class Casino Blackjack was actually written by an international blackjack player who has won thousands of dollars in 
casinos all over the world. It is the most powerful tool to the player who wants to master the skill of playing winning 
blackjack. 

World Class Casino Blackjack is the only computer game at which, if you are good enough to beat the dealer, you are good 
enough to win a million dollars. 



AVAILABLE AT 



WORLDS 
BIGGEST 
BOOKSTORE 

20 Edward St. 
Toronto, Ont. 



COLES 

the book people! 

EATON CENTRE 
Toronto, Ont. 



COLES 

the book people! 
726 Yonge St. 
Toronto, Ont. 



COLES 

the book people! 
COMMERCE COURT 
Toronto, Ont. 



x (5>^Purchase World Class Casino Black at any of the above locations and receive absolutely FREE a copy of the book. . . 
"BEAT THE DEALER" 
By Edward O. Thorpe 
"World Class Casino Blackjack" is published by NOVA COMPUTER SYSTEMS. 



Commodore 64 is a Trademark of Commodore Business Machines Inc. 



page 40 TPUG magazine 



SuperPET 6809 Assembler - Part IV 



Brad Bjorndahl 

Bramalea, ON 

This is the last of four articles on the assembler project PITS. A 
little more detail about the 6809 instruction set is necessary at this 
time. The 6809 processor is a very-much-enhanced version of the 
6800, which in turn is similar to the 6502. 

The enhancements include an extra stack pointer and index register, 
a direct page register and access to the 8 bit A and B accumulators 
as one 16 bit D accumulator. Also available are a set of extremely 
powerful addressing modes which can use any of the index regis- 
ters and stack pointers. A programmer can apply a constant or 
variable offset to a 'base' register using the A, B or D accumulators 
for the variable offset. That is, the constant or accumulator is 
added to the register to obtain an address. Also the programmer 
may cause the register containing an address to automatically 
increment or decrement by 1 or 2. This facilitates table handling. 
On top of these address options, the programmer can also apply 
indirect addressing. This means that the contents of the address 
location is treated as an address which in turn points to the data of 
interest. This feature is useful for using tables which contain addresses 
for subroutines, for example. Lastly, the constant offset option can 
be used with the program counter as the base register. This allows 
position-independent code to be written. 

Other enhancements in the 6809 are a number of 16 bit instructions 
for addition, comparisons, etc. There is an instruction which will 
multiply the 8 bit A and B accumulators and place the result into 
the 16 bit D accumulator. 8 and 16 bit signed addition may be 
performed in the 16 bit registers. 

Among several hardware enhancements are the addition of three 
software interrupts (see 'swi* in the last article) and improvements 
in the bit representation of some instructions to increase efficiency. 

The remainder of this article will describe selected parts of the 
program PITS which use some of the features described above. 

Listing 1 is part of the routine which creates the island. The 
instructions at locations B and E load the index registers X and Y 
with addresses which correspond to the top and bottom left of the 
screen in preparation for displaying the upper and lower island 
boundaries. The # symbol signifies immediate addressing which 
means that the registers are loaded with the two bytes immediately 
following the load instructions. The instruction at 12 loads B with 
the number of asterisks to display and at 14 loads A with the 
contents at location ASTER which happens to be the ASCII 
representation of '*'. The loop is very simple; it decrements B and 
branches back until B is equal to 0. The interesting parts are the 
'sta' instructions which store accumulator A (an '*'). The storage 
addresses are contained in index registers X and Y. The preceding 
comma means that there is no offset and the following plus sign 
causes the register to be incremented by 1. Two plus signs would 
mean an increment of 2. 

Listing 2 is an example of a variable offset. First B is loaded with 
the contents of location Z PTR, which is a pointer to a zombie. 
Then X is loaded with the address of Z MOVE CTR, which is an 
array containing the number of moves left for each zombie. Then 
the contents of the array, offset by the zombie pointer, are 
decremented. This code is executed whenever a zombie has moved. 
Elsewhere, the same array position is tested for zero, using the 
same offset indexing method. 



Listing 3 is a complete subroutine which is called during island 
building when a 'z' command is encountered. The subroutine 
. checks if the zombie position array is full, and if not, then it stores 
the new zombie position and displays the zombie on the screen. 
First, the zombie counter (Z CTR) is incremented and compared to 
MAX Z. This is done with a L cmp' instruction, which is basically a 
subtract that does not save the result but does set condition codes 
accordingly. The IF-FNDIF structure has not been previously 
described, but it is quite simple in this case. The 'if It' only allows 
execution if either the negative or overflow condition codes are 
set, but not both. Thus It' is translated as less than zero'. Within the 
IF, first the zombie counter is stored. Then Y is loaded with the 
contents of NEXT Z POS which was previously given the address 
of the array holding the zombie position. D is then loaded with the 
current row/column island position and stored in the position 
array. Register Y is automatically incremented by 2 in order to 
point to the next available place in the position array and is saved. 
When the current row/column position was determined, the cor- 
responding memory address was calculated and saved in RCADDR. 
Therefore, in order to display a zombie, it is necessary to store a 'Z' 
at the memory address pointed to by RCADDR. That is exactly 
what 'stb (rcaddr)' does. The '( )' symbols mean indirect addressing 
as described above. This routine is more difficult to describe in 
English than it is to write. It is included to illustrate the power of 
some of the 6809 machine instructions. 

Lastly is the routine in Listing 4 which converts a row/column 
position into a memory address. It was used to provide RCADDR 
in the last example and will illustrate some 16 bit operations. The 
routine assumes that row and column are in accumulators A and B 
respectively. Since people (that is, I) like to start counting at 1 but 
machines like to start at 0, it is necessary to decrement the row and 
column values. This is done with 'dec' and the column is stored in 
COL. I have used a trick here to be able to give one address two 
names that are meaningful, depending on whether 1 or 2 bytes are 
to be accessed. I have reserved memory bytes for COLUMN, so 
that its address is the same as ZERO. I clear ZERO and end up with 
a 16 bit value for COLUMN. Next, B is set to $50 and is multiplied 
by A (the row) using the 'mul' instruction. The product is in D to 
which is added first the 16 bit column value and then an offset of 
$8000 for the screen address. 16 bit arithmetic makes address han- 
dling quite easy. 

This completes my development of the PITS project. I have not 
touched some essential topics such as stack handling and methods 
of passing parameters to subroutines. These are probably best 
handled in a dedicated article. 1 must make two more comments 
before I close the subject. Those who examine the code in detail 
will find weak points in the usage of data arrays because they were 
omitted from the project design entirely. Let that be a lesson. 
Second, to prove to myself that the game structure is sound, I wrote 
the game in Waterloo microBasic with the identical structure as 
described. It ran correctly, but was a trifle (more than 20 times) 
slower. I hope that the last four SuperPET articles have provided 
more motivation for assembly language programming than a mere 
decrease in execution time. TPUC 

continued overleaf 



TPUG magazine page 41 



LISTING 1 

OOOB ; display top and bottom row boundaries 

000B ldx #$8000 

000E ldy #$86e0 

0012 ldb #$50 

0014 Ida aster 

0017 loop 

0017 sta ,x + 

0019 sta ,y+ 

001B decb 

001C until eq 



store an asterisk from $8000 to $804f 
and from $86e0 to $871f 



01FE 
0201 
0204 



ldb z_ptr 

ldx #z_mov e_ 
dec b , x 



ctr 



LISTING 2 

; decrement the number of 

; moves left to the zombie 



LISTING 3 



0131 
0131 
0134 
0135 
0138 
013A 
013D 
0141 
0144 
0146 
014A 
014C 
0150 
C150 



add 



ctr 



equ " rf 

ldb z 
incb 

cmpb max 
if It 

stb 

ldy 

ldd 

std 

sty 

ldb 

stb 
endif 
rts 



z_c tr 

next_z_pos 

rc_pos 

>y+ + 

next_z_po s 

#'Z' 

[ re addr ] 



increment the zombie counter 

if zombie counter is less than max 
save the zombie counter 

and save the row/column position 



and display a zombie 



0000 


c a lc 


_rcaddr equ * 


0000 






de ca 


0001 






decb 


0002 






stb col 


0005 






c lr zero 


0008 






ldb #$50 


000A 






mu 1 


OOOB 






addd column 


000E 






addd #$8000 


0011 






rts 


0012 


col umn 


rmb 


0012 


zero 




rmb $01 


0013 


col 




rmb $01 



LISTING 4 

on entry, row is in A and column in B 

this is to count rows and columns from 

instead of 1 so the calculation is correct 



the row number is still in reg 
multiply the row number by 80 
add on the column number 
add the screen address offset 

; 16 bit co lumn value 

; 8 bit col umn value 



page 42 TPUG magazine 



CLEARANCE SALE C-64 4 SLO 

CLEARANCE SALE OF 4 SLOT EXPANDER 

BOARDS FOR COMMODORE 64 by XETEC 

DEALER INQUIRIES INVITED 

REG. PRICE $119.00 SPECIAL CLEARANCE 

PRICE $89.00 . . . Save $30.00 

PLUGS into your Commodore 64 memory expansion port. 
Allows you to insert up to 4 CARTRIDGES at one time. 
COMPLETE with Reset switch. Fused power, plus spare 
fuse, GOLD PLATED CONTACTS. Three status indicators, 
for each slot, premium grade components. One YEAR 
WARRANTY COMPLETE DOCUMENTATION. 

MASTER CARD, VISA, MONEY ORDERS, PERSONAL 
CHECKS TAKE THREE WEEKS TO CLEAR. PHONE ORDERS 
ACCEPTED (we deduct $1.00 for the cost of your call). 
Phone 705-437-3187 from 9 a.m. to 10 p.m. Mon. to Sat. 

MAIL ORDERS TO: 



U 1 



B&R ENTERPRISES INC. 
PEFFERLAW, ONTARIO 
L0E1N0 



ONTARIO RESIDENTS ADD 7% PROVINCIAL SALES TAX 
($6.23). Shipping and Handling Insurance $6.00 per unit. 

. . . DEALER INQUIRIES INVITED . . . 

Free money saving catalog with every order 



/ 



"\ 



/ 



/ 



TeleTalk 

Telecommunications 

for your Commodore 64™ 

TeleTalk — has the same features as other 
more expensive terminal programs. 

Compare these features: 

— Uploading of text or programs with Block, 
Xon/Xoff, CP/M (Xmodem), Pet transfer, or 
prompted protocols 

— Downloading of text or programs with 
CP/M (Xmodem), Pet transfer protocols, or 
buffer storage (42 K) 

-Transfer of graphics, V/pro files, or other 

information is possible with the 

CP/M Direct-to-Disk protocol. 
-ASCII or Commodore Modes. 
-8 Programmable Macro Keys. 

— 1 2 Hour Timer and Status Line. 

— Output to serial printers. 

— Terminal Set-Up file and disk commands. 

Available on disk for $4! .95 + 7% PST 
From. ThunderWare Software 

RR#5 

Thunder Bay, Ontario P7C 5M9 



\ 



\ 



\ 



\ 



\_ 



./ 



/ 



/ 



HELP IS HERE 

FOR C-64 &VIC-20 
THE LITTLE BLACK BOX RESET SWITCH 

• REVIVE and SAVE all CRASHED BASIC PROGRAMS 
even after entering command "NEW" 
with aid of included program listing 

• Saves hours of work in retyping 

• Resets computer from ANY BASIC program lock-up 

• Easily installs in USER PORT 

• Will not void CBM warranty 

• Saves wear and tear on computer 

• Diode Protected Circuitry 

• Lifetime Warranty! 

Now only 14.95 CDN (II.95 U.S.) 
(LIMITED TIME OFFER!) 



Please send check or money order to: 
BESCO PRODUCTS 
203 - 8060 Granville Ave., Richmond, B.C. 
Ph: 604-278-5 1 1 5 




Canada V6Y IP4 



DEALER INQUIRIES INVITED 



TPUG magazine page 43 



OLYMPI A PR INTERS 



R.O. 

LETTER QUALITY 

DAISY WHEEL 

PRINTER 




INCLUDES 

RS232C and 

parallel interface 

Tractor feed 

10,12,15 pitch 



$54 9.0 



COMPACT 2 

LETTER QUALITY 

DAISY WHEEL 

PRINTER/TYPEWRITER 




INCLUDES 

Full featured 

typewriter with 

correction 

Parallel Centronics 

interface 

On line key 

$795.00 



EXCEL TYPEWRITERS LTD 

86 Sheppard Ave. West 

North York, Ontario 
Canada (416) 225-4121 

VISA MASTER CARD 



Now there's PASCAL 
for the Commodore 64. 
And at a mini price, 

Kyan PASCAL is a full-featured implementation of PASCAL 
-not a subset 1 With these features: 

□ high-performance compiler and comprehensive set of 
error messages for faster debugging 

□ speeds up to 40 times faster than Commodore Basic 

□ built-in full screen editor 

□ support for files, pointers, record types, sets and ordinal 
types used in sophisticated data structures. 

□ plus, a comprehensive tutorial manual illustrating the 
speed and power of PASCAL through sample programs. 

Kyan PASCAL lets you develop programs on your 
Commodore 64 that are transportable to most mainframes. 
So it's perfect for students and working at home. 

Try it for 15 days. 

Order Kyan PASCAL, and if you're not completely satisfied, 
return the diskette and manual within 1 5 days for a full refund. 
Kyan PASCAL with complete tutorial manual $49.95 

[Add $4.50 per copy for postage and handling. $9.50 out- 
side North America, California residents add 6.5% sales tax.] 

To order, call 415/775-2923. 

[VISA and MasterCard accepted.] 

Or send check or money order to: Kyan Software, 

Suite 183, 7850 Union Street, San Francisco, CA 94123. 

Sorry, no CO. D. orders accepted. 



Bkyan 



IF... 



All around you they are promising you more 
and giving you less 



THEN . . . 



phone, write or visit* 




CANADIAN SOFTWARE 
SOURCE 



MORE . . . SOFTWARE 
MORE . . . HARDWARE 
MORE . . . BOOKS 
MORE . . . DISCOUNTS 

Over 1500 products for the 
COMMODORE 64 



IF... 



you have not received our FREE NEW 
1984-85 CATALOGUE 



THEN . . . 



Call or Write 




CANADIAN 
SOFTWARE SOURCE 



Box 340, Station "W", 
TORONTO M6M 5B9 



(416)491-2942 



*NEW . . . 

Call or Write for the location of our 

NEW METRO TORONTO 
COMPUTERWARE CATALOGUE 
SHOPPING OUTLET 



page 44 TPUG magazine 



Using The User Port - Part 1 



David Williams 

Toronto, ON 

(This article is based on a presentation which was given by the 
author at the 1984 TPUG Conference). 

All Commodore computers are designed to interact with a wide 
variety of external equipment. For example, they can all be used 
with printers, tape-cassette decks, disk drives and modems. Many 
of them also come with sockets for plugging in other standard 
peripherals such as joysticks, external video monitors and sound 
amplifiers. In short, there are lots of off-the-shelf items which 
Commodore users can buy and connect to their computers. 

The range of peripherals is not confined to those which can be 
bought from computer stores. Commodore has incorporated into 
all PET/CBMs, VIC 20's and C-64's a "user port". This is intended 
to allow users to make their own peripherals and connect them to 
their computers. The port allows the computer to receive informa- 
tion from the outside world, and also to output signals which can 
be used to control external equipment. These articles will describe 
the main features of the user port, and outline some of the ways in 
which it can be used- 
Figure 1 is a diagram of the port, as seen looking into the computer 
from behind, showing its important connections. Physically, the 
port consists of a projecting part of the computer's main circuit 
board which is accessible through a large aperture in its case. On 
both the top and the bottom surface of the circuit board are twelve 
metal contacts, so there are twenty-four contacts in all. These 
contacts are connected within the computer to various points in its 
circuitry, so that connections to these points can be easily made by 
the user. Some of the connections are different on the various 
kinds of Commodore computer. However, the important contacts 
which are labelled along the bottom side of the circuit board in 
Figure 1 are the same on all PET/CBMs, VIC 20's and C-64's. These 
are the contacts with which this article will be mainly concerned. 



Port Connection Diagram 



+ 5 volts, 100 ma maximum 
(VIC20&:C-64ONLYl) 



(PET/CBM machines have 
power on cassette port) 



123456789 10 11 12 



ABCDEFHJKLMN 
Gro'und V s Gro'und 



User Port (Bit Numbers) 



fig-i 



Getting Connected 

It is important to realize from the outset that the contacts along the 
bottom of the port are quite separate from those along the top. 
Many a computer has spent a while in a repair shop because its user 
unthinkingly used an alligator clip, or something of the sort, to 
make a connection to the user port, thereby connecting a bottom 
contact to the one above it on the top of the board. I would strongly 



recommend anyone who plans to use the port to buy a "proper" 
connector for it. This connector consists of a strip of plastic contain- 
ing a slot which fits snugly over the projecting part of the circuit 
board in the port. Twenty-four metal contacts within the slot make 
connection with the contacts on the circuit board, and are accessi- 
ble through twenty-four separate solder-lugs on the outside of the 
connector. The spacing of the contacts is 3.96 millimetres (0.156 
inches). The total length of the slot is 52 millimetres (2.04 inches). 
A suitable, commercially-made connector is the Edac type 308-024 
400-202, a photograph of which is shown in Figure 2. 1 buy mine, in 
the Toronto area, at Electro-Sonic, on Gordon Baker Road, near 
Victoria Park and Steeles. 




Unfortunately, you may find these connectors hard to obtain. (In 
fact, in order to get a hundred of them for sale at the 1984 Conference, 
TPUG had to have them especially made! They were all sold long 
before the Conference was over). The twenty-four contact connec- 
tors are less common than other sizes. This has led many users to 
try desperate measures such as buying unsuitable connectors and 
cutting them to fit. If you try this kind of thing, I suggest that you 
take a ruler to the store so that you can check that the contact 
spacing is correct. If you buy a connector which is too long, then 
cut it to fit, make sure that you close the open end of the slot with 
some material such as epoxy glue so that the connector cannot slip 
sideways when installed. Slipped connectors can cause disasters by 
bridging together adjacent contacts on the circuit board. Another 
desperate measure is to cover the top contacts on the port with 
adhesive plastic tape (preferably a transparent kind, so that the 
contacts can still be seen), then to use alligator clips to make 
connections to the bottom contacts. This works as an emergency 
procedure, but I would not recommend it for routine use. The 
clips are liable to abrade through the tape before long! 

The Eight-Lane Highway 

As is shown in Figure 1 , the twelve contacts along the bottom of the 
port are normally described by labelling them with letters, A 
through N. (G and I are omitted to avoid confusion with other 
letters and digits.) The outermost pins, A and N, are both con- 
nected to "system ground". This is the reference point, relative to 
which everything else is measured. (Incidentally, the outermost 
pins on the top of the port are also grounded). Pins B and M are 
used for purposes which are beyond the scope of this article. The 
remaining eight pins, C to L, can all be used to send information 
into or out from the computer. This is done by switching the 

continued overleaf 



TPUG magazine page 45 



voltages on the pins between two levels, which can represent the 
digits zero and one. In a sense, the eight pins can be considered as 
being like a highway with eight separate lanes, each carrying its 
own independent flow of traffic. However, unlike a highway, the 
eight pins on the user port are not permanently divided into 
"inbound" and "outbound" channels. The user can choose whether 
any given pin should carry information into the computer or out 
from it. Any combination is possible. All the pins can be used as 
inputs, or all as outputs, or some of each. 

This choice of directions is made by POKEing an address called 
the "direction register". Like every other address in the computer, 
the direction register consists of eight bits, each capable of holding 
a binary digit of information — a zero or a one. The contents of each 
of the eight bits in the direction register determines whether one of 
the user port pins functions as an input or as an output. The least 
significant bit (Bit 0) determines the function of Pin C, and the 
sequence follows in simple numerical order, so that Bit 7 deter- 
mines whether Pin L is an input or an output pin. If a bit contains a 
zero, the corresponding pin is an input. A bit containing a one 
corresponds to an output pin. 

Renaming the Pins 

Here, I intend to make a change in nomenclature which should 
simplify the rest of this article. Instead of referring to the eight 
pins by their letters, C to L, I will instead use their bit-numbers, 
to 7. Thus, Pin C will be called "Pin 0", and so on. This should 
make things easier to undertand. However it is important to real- 
ize that these numbers have nothing to do with the numbers which 
are used to describe the pins on the top of the port. Don't get 
confused between them! 

The number which must be POKEd into the direction register 
must therefore have a bit-pattern which corresponds to the desired 
pattern of input and output pins. For example, if you want pins 2, 4 
and 5 to be outputs, and the rest to be inputs, you must POKE the 
direction register with the number in which bits 2, 4 and 5 are ones, 
and the rest zeroes. To do this, first look in Table 1 to find the 
address of the direction register in your computer (I'll call this 
address "DR"), then, either in direct mode or as a line of a program, 
execute the command: 

POKE DR,(2T2) OR (2T4) OR (2T5) 

(Oops! Maybe some of you are not familiar with the "Boolean 
operators" such as "OR". If you know all about OR, AND and 
NOT, just skip to the end of this paragraph. Otherwise read on. . . 
The OR operator performs an operation on two numbers to gener- 
ate a third. Here is an example: 

10010111 
01000110 



The numbers are expressed in binary notation, and the resulting 
number has a one in every bit-position where one OR the other OR 
both of the starting numbers has a one. Similarly, ORing the 
numbers 2^2, 2^4 and 2^5 (as in the previous paragraph) has the 
following effect: 

00000100 
00010000 



00010100 
00100000 

00110100 



The final number has the desired bit-pattern. The AND operator 
is similar, except that both of the starting numbers — one of them 
AND the other — must have a one in any position in order for the 
resulting number to have a one there: 

10010110 
01011011 



00010010 



The final Boolean operator is NOT, which has only one starting 
number and simply reverses all its bits: 

01100011 



10011100 



11010111 



There! Now you know all about Boolean operators in BASIC! I 
suggest that you experiment with them in order to become totally 
familiar with them). 

The first programming operation which must be done whenever 
the user port is to be used must be to POKE the direction register. 
A few people sometimes omit this POKE if they want to use the 
port only to input information into the computer. They rely on the 
fact that, when the computer is first switched on, the direction 
register usually contains a zero, making all the port pins inputs. 
However, my own experience is that this is unreliable. If the 
direction register has previously held a non-zero number, it may 
not be restored to zero if the computer is briefly switched off. I 
suggest, to be safe, that you should POKE the direction register 
even if you want all the pins to be inputs. 

Reading Input Pins 

Let's try a little experiment. To do this, you will need a user port 
connector and a piece of wire, preferably with an alligator clip on 
each end. (Wires with alligator clips on both ends are called "clip 
leads", and are sold in stores such as Radio Shack. I recommend 
any hardware experimenter to have lots of them). Connect one end 
of the wire to one of the grounded pins on the port and leave the 
other end unconnected for the time being. Switch the computer on 
and POKE the direction register to zero, so all the pins are inputs. 

continued on next page 



Addresses 


TAI 
PET/CBM(2.0AND4.0) 


tLEI 


VIC 20 


C-64 


Direction 
Register (DR) 


59459 

($E843) 


37138 
($9112) 


56579 

($DD03) 


Port(P) 


59471 

($E84F) 


37136 
($9110) 


56577 
($DD01) 





page 46 TPUG magazine 



Now PEEK the actual port address, which I call "P", and which is 
shown for all Commodore machines in Table I. You should find 
that it contains the number 255 (decimal), which, in binary notation, 
is 11111111 —an eight-bit number in which every bit is a one. Now 
connect the free end of your grounded wire to one of the eight port 
pins C to L, which are now renamed to 7. Let's suppose that you 
ground Pin 3. PEEK the port address again. You should find that 
you now get 247 (decimal), which has the bit-pattern 11110111. Bit 
3, corresponding to Pin 3, has become a zero. (Remember that the 
rightmost bit in a binary number is called Bit 0, since it represents 
2T0. The leftmost bit, Bit 7, represents 2T7.) Do some more 
experiments, connecting various of the pins to 7 to ground and 
PEEKing the port address. More than one pin can be grounded at 
one time, if you wish. You should find that the port address always 
contains a number in which the bits corresponding to the grounded 
pins are zeroes and the rest are ones. 

If you have a voltmeter available (all serious hardware hackers 
own voltmeters), try measuring the voltages on the ungrounded 
pins. You should get approximately +5 volts, relative to ground. 
The grounded pins, of course, are at zero volts. These two voltages, 
+ 5 and 0, are the standard TTL (that's short for "Transistor- 
Transistor Logic") voltage levels to represent the digits one and 
zero, respectively. If any input pin on the port is at roughly +5 
volts (say between + 4 and +5), the corresponding bit in the num- 
ber found by PEEKing the port address is a one. If the pin is close 
to zero volts, the bit is a zero. Thus information can be fed into the 
computer from the outside world by connecting something to the 
port which drives a pin to either +5 or volts, and running a 
program which PEEKs the port address and looks at the appropri- 
ate bit. 

The Boolean operator " AND" can be used to look at just one bit of 
a number. For example, if you want to look at bit 5, simply AND 
the number with 2T5. Thus if you want to write a program which 
will do something if Pin 5 of the user port is at zero volts simply use 
the condition: 

IF (PFEK(P) AND (2T5)) = THEN . . . 

This condition will be satisfied whenever bit 5 in PEEK(P) is a zero, 
irrespective of all the other bits. Incidentally, the outermost brack- 
ets are very important. Without them, the condition will never be 
satisfied since 2T5 never equals zero! The "equals" operator is 
performed before U AND", unless brackets are used to force the 
opposite order. 

1 hope you will now have no problem in seeing that the following 
condition is the one to use if you want the computer to do some- 
thing if Pin 2 is at +5 volts: 

IF (PFFK(P) AND (2T2))X) THEN . . . 

More Observations 

The results of our little experiment of looking at voltages on input 
pins suggest some other important facts. 

First: The voltage on any pin of the user port should NEVER be 
driven outside the TTL range of zero to +5 volts, relative to 
ground. There are some people who cheerfully put voltages well 
outside this range onto the port and get away with it. Similar 
people plug air-conditioners into lighting circuits in the expecta- 



tion that the circuit designers will have put large enough salety 
margins into their calculations to make such overloads possible. 
Fire marshals know that people who do this kind of thing some- 
times get away with it for a while, but rarely for ever. 

Second: A voltage of +5 volts represents a logical one, and zero 
volts represents a logical zero. If the voltage is wrong by half a volt 
or so, the logical digit will not be changed. However, there is a 
"hazy" region around +2 or +3 volts where the system will not 
reliably determine which digit is indicated. Putting an intermedi- 
ate voltage such as these onto a user port pin will not cause any 
physical damage, but it will tend to make your logical system work 
unreliably. 

Third: An input pin which is not connected to anything outside the 
computer is held at +5 volts, and a logical one, by the internal 
circuitry of the computer. To make it read a logical zero, the pin 
must be grounded. In practical circuits, this grounding is often 
done through a resistor, so that the pin can be put back to +5 volts 
by driving a current through the resistor. 1 have found that, in 
practice, the resistor must have a value of no more than about IK 
(1000 ohms) in order for the pin reliably to appear at a logical zero. 
Usually, I use 470 ohms or thereabouts. 



Programming Output Pins 

Let's make the user port pins into outputs, and try another 
experiment. To do this, you'll need a voltmeter. If you don't have 
one, I guess you'll just have to read along and take my word for it. 

Make all the pins into outputs by POKEing the direction register 
with 255 — the number in which all eight bits are ones. POKE the 
port address with zero, and measure the voltages of all the eight 
pins, relative to a ground pin. You should find that they are all 
close to zero volts. Now POKE the port address with 255 and 
measure the voltages again. All the pins should be close to + 5 
volts. 

POKE the port address with the number 245, which has the bit- 
pattern 11110101. Measure the voltages. Pins 1 and 3 should be at 
zero volts, the rest at +5 volts. This corresponds to the fact that bits 
1 and 3 in the binary equivalent ol the number 245 are zeroes and 
the rest ones. Try POKEing the port address with other numbers 
and measuring the voltages on the pins. You should always find 
that the pattern of +5 and voltages on the pins matches the 
bit-pattern of the number you have POKEd into the port. Each bit 
in the port address controls one output pin. 

Try POKEing the direction register with a number between zero 
and 255, then repeat the experiment of POKEing various numbers 
into the port and measuring voltages. You should find that your 
POKEs to the port address can influence only the pins which you 
have programmed to be outputs with the direction register. For 
example, if bit 5 in the number you have put into the direction 
register is a one, pin 5 can be switched between zero and +5 volts by 
POKEing the port address. However, if bit 5 in the direction 
register contains a zero, this pin is an input and is unaffected by 
POKEs to the port. Like all unconnected input pins, it remains at 
+ 5 volts. 



continued overleaf 



TPUG magazine page 47 



Why a Voltmeter? 

Those of you who don't have voltmeters may be tempted to try the 
above experiments with some other means of detecting voltages, 
such as flashlight bulbs. Surely, if a bulb is connected between 
ground and a user port pin which is at +5 volts, it should light. If 
the pin is at zero volts, the bulb will not light. Try this if you like, 
but you're inviting disappointment. The bulb will never light, no 
matter what numbers you POKE into the direction register and the 
port address. 

The problem is that the output pins on the user port are each 
capable of supplying a current of only about one milliamp (one 
thousandth of an ampere) at +5 volts. A voltmeter takes far less 
current than this, so it responds properly in our experiments. 
However, a flashlight bulb requires much more current to light 
— typically around a hundred milliamps. If an output pin on the 
user port is at +5 volts and a flashlight bulb is then connected 
between it and ground, it cannot supply enough current to light 
the bulb. Instead, the voltage on the pin is dragged down close to 
zero volts, almost as if the pin were grounded with a thick piece of 
wire. 

Incidentally, the internal circuitry of the computer is set up so that 
grounding output pins is not supposed to cause any damage. 
However, to be on the safe side, I would not recommend doing it 
for long periods. 



POKEing One Bit at a Time: 

When a number is POKEd into the port address, its bit-pattern 
determines the voltages on all the output pins. In practical situations, 
if there are several devices connected to different output pins, a 
programmer is likely to be interested in writing code which will 
control them one at a time, not all at once. What is needed is a 
technique, in BASIC, of changing just one bit in a number, leaving 
the others unaltered. 

Several operations are needed. First, the port address is PEEKed 
to find what number is already in it. Boolean operations are then 
done to change just one bit in this number, and the resulting 
number is POKEd back into the port address. In practice, these 
operations can usually be written into one line of code. For example, 
if you want to POKE the port address so that it will contain a one in 
bit 4, simply execute the instruction: 

POKE P,PEEK(P) OR (2t4) 

Whatever number was originally in the port address is ORed with 
2^4. If you recall what the OR operator does, you should recognize 
that this forces a one into bit 4 and leaves all the other bits unchanged. 
The resulting number is then POKEd into the port. 

To force a zero into a bit-position in the port address is only 
slightly more complicated. Here is an instruction which will make 
bit 6 contain a zero, and leave all the other bits unchanged: 

POKE P,PEEK(P) AND NOT (2t6) 

NOT (2^6) is a number which has a zero in bit 6 and a one in every 
other position. ANDing this number with PEEK(P) produces a 
new number which has a one in every position where PEEK(P) has 
a one, EXCEPT bit 6, which is bound to contain a zero. 



A Slight Snag 

The logic of the last few paragraphs depends on an assumption 
which seems so obvious that it is virtually never questioned. It 
assumes that PEEKing the port address will produce a number 
which represents the "true state" of the port, so that every output 
pin which is supposed to beat +5 volts will be represented by a one 
in the corresponding bit-position. 

This assumption can occasionally (fortunately avoidably) be wrong. 
PEEKing the port effectively measures the actual voltages on the 
pins. If an output pin is connected to an external device which 
draws more than about one milliamp from it, its actual voltage may 
be well below + 5 volts even though it is programmed to be at +5 
volts. PEEKing the port address may then produce a number 
which has a zero, instead of a one, in the corresponding bit-position. 
(You can easily confirm this experimentally, if you want, by ground- 
ing an output pin and PEEKing the port.) When this number, 
modified by Boolean operations on another bit, is POKEd back 
into the port, the result is to reprogram the low-voltage output pin 
to be at zero volts, so it ceases to supply any current to the external 
device to which it is connected. This can mystifyingly cause exter- 
nal devices to be affected by instructions which are intended to 
affect only other pins. 

This problem never occurs unless an output pin is held at a low 
voltage by an external connection which draws too much current. 
For this reason, I make a practice of making all connections to 
output pins through resistors of at least 4.7 kilohms. These resis- 
tors limit the currents taken from the pins to acceptable levels. All 
I then have to do is to design my external circuitry in such a way 
that these small currents are enough to perform the functions I 
want — which is an entirely different problem! TPUG 

To Be Continued. . . 




Program Cheeks: 

* Electronics 

• Speed & dtek clamping 

* Radial head alignment 

• Mechanical stop location 

Package Includes: 

• Trufc distal alignment disk 

* Replacement quiet dtfve stop 




-* 



ORDER NOW! 

800-762-5645 

Hours 10>6 M on, Sat. 

CARDINAL SOFTWARE 

13646 Jefferson Davis Highway 
Woodbridge, VA 22191 



page 48 TPUG magazine 



Super Action Software! 




Perplexian Challenger $29.95 

The increditily responsive trtree-ams iciv*tn# contrui of 
soace hghte. J it jh your 1 hands Split screen graphics provide 
a con un uous display nl your shiu's instrument anon, as wel\ 
i > i- • L!^.«limeri&iQnal animated viertr □( space 

Ycu. as a pilot, must utilize hgnt-mng fast reflexes tu destroy 
invading ships, and avoid the»r return lire Simultaneously, you 
must maneuver your ship to capture space debris that 
remaps tram the en plosion 5 

Outstanding graphics features include smooth 3-D 
rotations. sphL screens and the most fncredioie high- 
resolution hyperspace seguence ever produced 

Programmed entirely m machine language, this action- 
strategy came »s guaranteed to blow you away. 

Ad the professional features you expect are included, 
automatic self-dema, high score retention, pause, and 
pro visions for 1 co 4 players. Add to tins,, features you don't 
expect like easy-loading, and muse during the load Penile* ran 
Challenger is a game that brings the arcade experience to your 
home 




PROCR€XTIV€ 

asm/. 



C 



DENVER, COLORADO 

CYBERWORLD $3995 

This five-screen arcade adventure packs the computer nyith 
intense graphics and sound! Yr«u are 3 special Cyber league 
agent in a universe full of hostile a^ens and vicious robots. 
J . '■• - ana keyboard transport you through 3-D rutin ib, 
space homers, fleets of invaders, and warship-ndden 
quad rants ol space Over 1 OD sprites 8 new character set* 
and dozens of mind- boggling sound effects make up this multi- 
layered adventure Animation, action, <md strategy a\* 
combined into a gam© so extensive that two disk sides are 
jammed with game programs and data! Reach the uStimate 
rank of admiraf and you may carve a niche m the parmarient 
high-score list A full-size book quality manual with fulf-color 
covers is included to guide you through your most exerting 
game experience 



cDT^aRds39 95 

Jump from ropes to ladders, dodge plummeting boulders and 
duck under deadly arrows in your quest for sparkling diamonds, 
gfotnrrtnj bars of sold, Wtd elisceninn, pearls. Wirh joysrick in hand 
you must explore forty darling scieens, each a new and exciting 
jdvenrurc. I jkc the key MS unlock ihe doorway ro your next spine- 
tingling level. Each key restores your mimical powers, allowing you 
to dm uver ten different «pc lis. With tints* magic spells you have the 
powrr to rwercume victor-, creatures, terrifying traps, and perilous 
plunges. 

Your Wizard is rcalistiL^I lv animated in ever,, possible directum. 
Dozens of rnovements are possible — jump over burning fires, 
shimmy up or down ropes and ladders, even slip down tn ichorous 
sliding Kaitcayes! Magic portals move your Wizard through midair 
.md protect you from a myriad of fully-animated fiendish monsters. 
Catch an devaror to the top of the screen and dart through sliding 
gates in four quest for magic and treasure. 

Wizard's fascinating variety of screens are sure to please and 
entertain, ^nd o; course you can build an unlimired number or your 
own levels using the construction set provided with your yame. 




PROFESSOR ^ 

An in-dcplh self-tulurial for the Commodore 64 on a Iwo- 
sided disk. This menu-driven tutorial covers every aspect 
of your C-64 — BASIC, keyboard, sound, music, simple and 
advanced gr.ipihii.s. Quizzes lest your comprehension il 
the end nf m t my W'svims! On -screen illustrations, sound 
effects and full-color interacti ve graphics nulla; learning 
ci_y and interest ing. The PROFESSOR is your ONLY choice 
l\u an all-in-one, thorough tutorial nhool the Commudnre 64! 




(ioiljmng's |daxr $39.95 

Reat-time adventure excitement ai lis best Solve countless 
pu^le-5 and slay over a dozen monsters Oy using the huge 
vocabulary of over 200 words Two challenging difficulty levels 
await you with over BO areas., each fully described in Old English 

SCMp! 

Menacing monsters knmng villains, tattered code books and 
ir^acnemus lerram are |ust a lew of the sjtuaiions you must 
overcome m your quest (of fchjllwieen priceless Ir-easures Wore 
shan seventy objects are <nvaJuaole to you in your search tor glory 
and weaith' 

A lull size, thoroughly illustrated fttariUil is included Featuring 
color ban! and back. book qualify and a lotd-out map. this 
extra further extends tne professionalism ol this garm. The 
following are quotes from unsolicited testimonials sent to us by 
adventurers m Goihmogs I. air 



' I have exiremofy emiiiyed Gothmog ! 
adventure games 



Gothmog s Lair is ihfi best ad 
CM 



Ldir iij plan to buy more 

ScDtt Tulman 
Memphis. TN 

nlure I ve ever played 

Denns Manochio, Jr 
Saratoga CA 







Supershipper 64 

A complete multi-printer shipping sysiem which operates 
on the inexpensive Cum mot lore M. Olfers .ill the features 
of more expensive, more cunihei some business >ft w 'i e a I :i 
low. low price. Full-sen n. I ull-cursor editing on all data 
entry. Prints invoices. C.U.1J. Uigs. mailing ami .shipping 
labe; . Sorts jWtif customer list aphabrlically. bvcily slale 
or by salespi- ::;uii- Keeps cumpli'le records of rill invoices 
and accounts on disk — up to 800 accounts per disk! Auto- 
matic backups, producl charts and many other features 
are also included. 



Supershipper Accounting 

The accounting supplement to the Supershipper 64. Prints 
siaiements. hank deposits, past due accounts ami daily or 
monthly sales reports. Breaks down sales commissions and 
prints all customer's past I ransacl ions. Also provides 
inventory control for op to 200 different producls. The only 
way lo fully computerize your business! 

Supershipper 64 $99.95 

Supershipper Accounting $79.95 




Progressive Peripherals & Software 

2186 South Holly, Suite #2, Denver, Colorado 80222 



Call for more information or a dealer near you. 

TELEX: 888837 (303)759-5713 (303)757-0830 TWX 



Cs 



9109971314 
TPVG magazine page 49 



Forecasting With The 8032 — Part IV 



John Shepherd 

Islington, ON 

The TPUG February PET disk, (P)T6, contains four programs 
which can be used to project historical data into the future, through 
a process called time series analysis. The first three parts of this 
series of articles (TPUG Magazine, May, June and July 1984)defined 
some of the forecasting terminology and concepts, and showed 
how two of these programs are used. 

Moving Averages 

The third program on the disk, "forest ma. 8", uses moving aver- 
ages of historical data to generate forecasts. An "N-period simple- 
moving-average 1 ' is merely an arithmetic average of the most 
recent N observations of historical data. The forecast is equal to the 
calculated value of this moving average. 

The apparant simplicity of this forecasting procedure is deceptive. 
There are many applications in business where there is so much 
variability in the historical data that the simple-moving-average 
forecasting model performs just as well as much more sophisti- 
cated techniques. 

Recent developments in the theory of time series analysis were 
consolidated by G.E.P. Box and G.M. Jenkins in 1970, in their 
classic text Time Series Analysis, Forecasting, and Control. These fore- 
casting techniques, called Box-Jenkins models, are complex but 
generally produce superior results. However, the procedures are 
time-consuming to implement and preferably require about 100 
observations of historical data. I have had experience with monthly 
business sales forecasts, where a six-month simple moving average 
produced just as accurate forecasts as the optimum Box-Jenkins 
model. Box-Jenkins models are beyond the scope of this series of 
articles and are not included among the programs on the TPUG 
disk. I suspect, however, that for many applications these TPUG 
programs can provide close-to-optimum forecasts. 

The properties of the simple-moving-average method depend 
upon N, the number of historical observations to be averaged. If N 
is large, the moving average will react slowly to changes or trends 
in the data. If N is small, the moving average will react more 
quickly and will be more influenced by random fluctuations in the 
data. For most data there is often an optimum N which produces a 
minimum forecast error. 

The Naive Model 

If N=l, then the forecast is equal to the most recent recorded data. 
This is called the "naive" model, and is the forecasting process 
used intuitively by most of us in our daily lives, in situations where 
there is no obvious trend or seasonality and no obvious degree of 
randomness in the data. 

In business the naive model is useful in perhaps 30% of all short- 
term forecasting situations. The program "forest ma. 8" uses the 
naive model as an option, so that its results can be compared 
against other moving average models. 

Moving Averages for a Trend Process 

A simple-moving-a\ -age will always lag a trend in the data. The 
larger the value for , the larger will be the lag. For this reason, 
simple-moving-averages are not used for forecasting where the 
data shows a pronounced trend. A double-moving-average method 
is often used in such situations. 



A "double-moving-average" is merely a moving average of the 
simple-moving-averages. The following formula is used to calcu- 
late the forecast, which is corrected for a linear trend: 

F = (2*M1-M2) + 2*LT*(M1-M2)/(N-1) 

where: 
F is the forecast for LT periods ahead 
LT is the forecast lead time 
Ml is an N-period simple-moving-average 
M2 is an N-period double-moving-average 
N is the period for both moving averages 

Program "forest ma. 8" 

Load the program and run it. The program first asks for the name 
of a data file and calls it into memory. Load the sample data file 
"forest data. 8". The data can be displayed graphically, if desired, 
to see whether it appears to have any seasonality or trend. This 
data seems to have both. 

Next, choose one of three forecasting models; the naive, the simple- 
moving-average, or the double-moving-averagc. As a general 
principle, always choose the simplest forecasting model that might 
reasonably work. It's often informative to compare the perform- 
ance of the naive model with one of the other two. For our data, 
let's try the double-moving-average model. Enter next the desired 
forecast lead time, let's say 2 periods or 2 months. 

If one of the moving average models has been chosen, the program 
asks whether you wish to input the moving average period, N, or 
whether you wish to have the computer calculate the forecast error 
for a range of periods and determine the optimum period. For our 
data, let's find the optimum, for a range of 2 to 12 months. 

For any of the three models chosen, the program next asks whether 
we wish to make any multiplicative corrections for seasonality (see 
part II, TPUG Magazine, Juneissue)andifso, asks for the period of 
seasonality. If there is any doubt whether seasonality is significant, 
it is wise to try this option. Even the naive model becomes extremely 
useful when corrected in this manner. For our data (monthly beer 
sales), we obviously wish to correct for seasonality. 

The program then goes to work and calculates forecast error over 
the entire time series (for our data, over the prior 60 entries). It 
displays the mean square error (M.S.E) and the mean absolute 
deviation (M.A.D.) of these forecast errors for each moving aver- 
age in the range chosen. 

For our data file the optimum moving average period is 9 months. 
The M.S.E. is 1.7 units and the forecast for period 62 is 21.2 units. 
(A unit is one-thousand cases of beer). This means that we can 
expect our forecast to be accurate to within plus or minus 1.7 units 
two-thirds of the time and to within plus or minus 3.4 units 95% of 
the time. If we display the forecast error versus time we can see that 
the error looks random and that the forecast can probably not be 
improved very much by other models. 

In the next article we'll look at the program "forest exp.8". This 
program also produces short-term forecasts but uses a special kind 
of moving average, using a technique called "exponential smoothing". 
TPUG 

To Be Continued. . . 



page 50 TPUG magazine 



Accurate C-64 Timekeeping 



Glen C. Bodie 

Toronto, ON 



Commodore computers use a version of BASIC which has two 
built-in system variables for use in keeping track of the time: TI 
and TI$. Information on these can be found in The Commodore 64 
User's Guide on page 113 or in The Commodore 64 Programmers 
Reference Guide, page 89. 

These variables are both based on the system "jiffy" clock. This is 
an interval timer which is updated every l/60th of a second by the 
system. The TI variable returns the interval timer value numerically. 
The TI$ variable is updated by the interval timer, but is read and 
written as a character string which contains "time" in a 24-hour 
HHMMSS format. Either of these (especially TI$) can be very 
useful when you are writing a program which wants to keep track 
of the time. Once you set a value in TI$, the system will keep the 
time updated for you, 

A simple program which allows you to enter a time, and then 
displays the time back to you like a clock is shown in Program 'A'. 
Note that in order to prevent getting a BASIC error message, there 
should really be some checking on the values entered for the time. 

The Commodore 64 User's Guide does not mention it (The Commo- 
dore 64 Programmer's Reference Guide does), but the values of these 
system variables are not accurate following tape I/O. This is because 
the l/60th second system interrupt is disabled during part of the 
I/O process. What both Guides fail to mention is that these system 
variables are also not accurate following disk I/O. 

If you are trying to write a program which keeps track of the time 
and also does some I/O (disk or tape), this can be a real headache. 
There seem to be only a few alternatives: 

1) Use machine language to modify the interrupt code so that the 
l/60th second interrupt is not disabled during I/O! 

2) Derive some sort of algorithm which tries to "account" for the 
time which is lost: ie. add 7.33 seconds to the time, because the disk 
write was for 23 blocks and had to do 2 track seeks! 

3) Forget about trying to keep track of the time or forget about 
doing any I/O! 

4) Find another way to keep accurate time even when doing I/O. 

It is this fourth alternative that turns out to be the best. Off-hand, 
that sounds like a formidable task, but the Commodore 64 has an 
easy way to do this. I am referring to one of the many wonderful 
abilities of the CIA chip (Complex Interface Adapter). The C-64 
has two of these which are described in great detail in The Commo- 
dore 64 Programmer's Reference Guide in Appendix M starting on 
page 419. 

The way the C-64 is put together, CIA #1 is used primarily to 
interface to the keyboard and joysticks, and CI A #2 is used primar- 
ily to interface to the serial bus and the user port. None of these 
functions interferes with one of the other functions of the CIA 
chip — maintaining a TOD (Time-of-Day) clock. It is this TOD 
clock which we will use to keep the time. 



NUMBER 


in BCD 


01 


0000 0001 


09 


0000 1001 


10 


0001 0000 


25 


0010 0101 


99 


1001 1001 



Using this TOD clock is certainly more complex than using the 
TI$ variable, but at least it doesn't lose any time! It is more 
complex because the TOD registers are designed for use in driving 
a digital display and thus present their data in BCD (Binary Coded 
Decimal). BCD is an encoding technique which keeps decimal 
numbers in a format which is easy to understand, but difficult to 
calculate with. The examples below show some numbers stored 
in BCD format and in ordinary binary (internal computer format). 



in Binary 

0000 0001 
0000 1001 

0000 1010 

0001 1001 
0110 0011 



In the BCD format, the largest number which can be held in one 
byte (8 bits) is 99, since each 4 bit "nybble" is treated separately, and 
can only hold the decimal digits between and 9 inclusive. In 
binary, the maximum is 255 since the two nybbles are joined 
together and each can hold a number up to 15. That is enough for 
BCD, now let's look at the registers in the CIA chip which are used 
when dealing with the TOD clock. 

In total, there are 16 registers presented externally which are part 
of each CIA chip. The only ones which we need to concern our- 
selves with when using the TOD clock are registers 8, 9, 10, 11,14 
and 15. These are mapped into the C-64 memory at locations in the 
range 56320-56335 (DC00-DC0F) for CIA #1 and 56576-56591 
(DD00-DD0F) for CIA #2. The address for a particular register is 
obtained by adding the register number to the starting address for 
the desired CIA chip. The functions of the various registers are 
explained below. 

8) TOD 10th of seconds: 

This register contains the tenths of seconds data for the TOD clock. 
It is encoded in BCD, but since the maximum value is 9, this is not 
of any concern. 

9) TOD seconds: 

This register contains the seconds data for the TOD clock. It is 
encoded in BCD as well. 

10) TOD minutes: 

This register contains the minutes data for the TOD clock. It is 
encoded in BCD as well. 

11) TOD hours: 

This register contains the hours data for the TOD clock in a 
12-hour format. The high order bit (bit 7) indicates whether the 
time is AM or PM. If the high order bit is masked out, the rest of 
the register data is just hours encoded in BCD. 

14) Control Register A: 

The high order bit (bit 7) of this register is used to determine what 
frequency base is to be used for timing. We do not really need to do 
anything to this bit, since it is set to zero when the system is 
powered-up and this means 60 Hz. The construction of a C-64 (in 
North America, at least) has a 60 Hz signal applied to the frequency 
input pin on the CIA chip. 

continued overleaf 



TPUG magazine page 51 



15) Control Register B: 

The high order bit (bit 7) of this register is used to interpret any 
data written into the TOD registers (8-11). If this bit is zero (as it is 
when the system is powered up), it means write to the current time. 
If this bit is one, it means write to the alarm time. 

You may have noticed that bit 7 of register 1 5 allows you to write to 
the alarm time. The CIA chip will keep an alarm time and gener- 
ate an interrupt when that time is reached. Handling this interrupt 
is beyond the scope of this article and requires the use of register 
13, the Interrupt Control Register in order to allow the interrupt 
to occur and to handle it when it does occur. 

In order to use this TOD clock in your programs, you need to be 
able to take a time value entered via the keyboard, put that value 
into the TOD clock, and then read and display that TOD clock 
value whenever you need it. Program 'B' is a subroutine which can 
be called to get the time data from the keyboard and put it into the 
TOD clock. Program 'C 1 is a subroutine which can be called to read 
the time data from the TOD clock and write it to the screen. Both of 
these can be incorporated into your programs without too much 
modification. 

There are a few tricks to using the TOD clock. In order to set the 
time, the following sequence of operations must be performed in 
exactly this order: 

1) Write to the hours register (11) 

2) Write to the minutes register(lO) 

3) Write to the seconds register (9) 

4) Write to the lOths of seconds register (8) 



The write to the hours register stops the CIA chip from updating 
the TOD clock, and the write to the IOths of seconds register starts 
the CIA chip updating the TOD clock again. This guarantees that 
the seconds or minutes don't roll over and change your hour data 
after you entered it and thus the time starts exactly where you want 
it to. 

In order to read the time, the following sequence of operations 
must be performed in exactly this order: 

1) Read the hours register (11) 

2) Read the minutes register (10) 

3) Read the seconds register (9) 

4) Read the IOths of seconds register (8) 

The read of the hours register freezes the TOD clock, and the read 
of the IOths of seconds register un-freezes it. During the freeze, the 
CIA chip is still updating the values, but the registers presented to 
the outside world (that's us) are not allowed to change. This guaran- 
tees that you get a consistent set of time data, not some data before 
the hour rolled over and some afterwards. It is possible to read any 
register except the hours by itself, but if you read the hours, you 
must then read the IOths of seconds in order to un-freeze the 
registers. 

Hopefully, this description and the accompanying programs will 
prove useful to you when trying to keep accurate time with your 
C-64 while doing I/O. If nothing else, this should help make you 
aware of the many features hidden away inside your computer just 
waiting to be discovered! 

continued on next page 




The key to the system — 
simple but sophisticated 

The problem with many computer sytems is that 
they can be too complex, too confusing and too 
cumbersome. So, when we started to design this 
system, we decided it wouldn't fall into any of 
these traps. 

• Once your records are set-up, the power of the com- 
puter can be used to manipulate them at the press of a 
single key. 

• You can store, standard letters together with selected 
information. This letter may be sent to one, all or 
selected people — you choose. 

• The file can be manipulated by a SEARCH feature which 
sorts out selected records according to your 
requirements. 

• The CHANGE KEY feature allows a data file to be 
re arranged (sorted) to a different sequence on any 
field. 

• If you can handle a manual index-card file, then you 
can handle this computer system. 

Distributed by: 




705 Progress Avenue, vUnir 17 
Scarborough, Onrario M1H 2X1 
(416) 431-3200 



page 52 TPUG magazine 



100 REM PROGRAM 'FT 

110 REM TITLE RND INPUT INSTRUCTIONS 

120 PRINT ,, 3 ,, TREa3>"KEEPING TIME": PRINT 

130 PRINT TAB a 3)" PROGRAM 'R'": PRINT: PRINT 

140 PRINT "ENTER THE CURRENT TIME IN 'HHMMSS'" 

150 PRINT "FORMAT WHERE 'HH' IS HOURS FROM 00-23" 

160 PRINT TAB a 3 VMM' IS MINUTES FROM 00-59" 

170 PRINT TRBOVAND 'SS' IS SECONDS FROM 00-59" 

ISO PRINT: INPUT "ENTER THE TIME:";K* 

190 REM SAVE THE INPUT DRTR IN TI* 
200 TI*=K* 

210 REM DISPLRV THE CURRENT TIME 
220 PRINT "3": PRINT: PRINT: PRINT 
230 PRINT "CURRENT TIME IS" 

240 PRINT: PRINT: PRINT "PRESS ANY KEY TO STOP THE PROGRRM TTI " 

250 K*=TI* 

260 PRINT TAB'*" 16> "Z]" LEFT**: K$,2>" : "MID*CK*,3,2> " : "RIGHT* <CK*, 2 > 

270 GET K$: IF K$="" THEN GOTO 250 

100 REM PROGRAM 'B' 

110 REM TITLE AND INPUT INSTRUCTIONS 

120 PRINT "3"TAB<13> M KEEPING TIME": PRINT 

130 PRINT TAB a 3 V PROGRAM 'B' n : PRINT: PRINT 

140 PRINT "ENTER THE CURRENT TIME IN 'HHMMSS'" 

150 PRINT "FORMRT WHERE 'HH' IS HOURS FROM 00-23" 

160 PRINT TAB a 3 VMM' IS MINUTES FROM 00-59" 

170 PRINT TAB<9>"RND 'SS' IS SECONDS FROM 0O-59" 

1Q0 PRINT: INPUT "ENTER THE TIME:";K$ 

190 IF LEN<K$!>06 THEN GOTO 310 

290 IF INKVAL<LEFT*<»<*,2:>>:»23 OR INKVAL<LEFT$<rK*^2> > ><0 THEN GOTO 310. 

210 IF INKVAL<MIQ*<K*^3,2>>>>59 OR INK VflL<MID*<rK$. r 3..2:> > ><0 THEN GOTO 310 

220 IF INKVAL<RIGHT*<K*,2>>>>59 OR INKVAL<RIGHT*f K*^2> > ><0 THEN GOTO 310 

230 FOR 1=1 TO 6 

240 if asc<:mid*<:k*,i,i:>}<48 OR ASC<MID*<K*,I,i:>:»57 THEN GOTO 310 

250 NEXT: CIA=56320 

260 I=VAL<LEFT*<K* J r2>;)': Z=0 : IF I>11 THEN Z=l : 1 = 1-12 

270 POKE CIA+ll.,Z*12S+INTa/10>*16+I-INKI/10>*10 

280 I=VAL<MID*<K*,3,2>>: POKE CIfl+10, INKI/10>*16+I-INKI/10>*10 

290 I=VRL<:RIGHT*CK*,2>>: POKE CIA+9,INKI/10>*16+I-INKI/10>*10 

300 POKE CIA+3,0: GOTO 330 

310 PRINT "ffllNVALID DATA ENTERED ! 3" 

320 FOR 1=1 TO 2000: NEXT: GOTO 120 

330 PRINT: PRINT: PRINT "TIME STORED IN THE CIA TOD REGISTERS" 

340 END 



100 REM PROGRAM 'C 

110 REM DISPLAY THE CURRENT TIME 
120 PRINT M 3" ' PRINT: PRINT: PRINT 
130 PRINT "CURRENT TIME IS" 

140 PRINT: PRINT: PRINT "PRESS ANY KEY TO STOP THE PROGRAM .3D" 

150 PRINT "3"TRB<16> ; 

160 CIA=56320: I=PEEKCCIR+1 1 •' : Z=a + <<I AND 128>=0> >*12 : 1 = 1 RND 127 

170 I=Z+INK 1/16^*10+1- INK 1/16**16: K*=RIGHT${ ,, 0"+RIGHT*CSTR*C I > , 1-<C I>9> > .,2> 

130 I=PEEK«::CIA+10:*' : I = INK I/16>#10+I-INTC 1/16**16 

190 K*=K*+RIGHT*v "0 n +RIGHT*<:STR*<r I > , 1 -< I>9 > > ..2 > 

200 I=PEEK'::CIP+9> : I = INK I/16>*10+I-INK 1/1 6>*16 

210 K$=K*+RIGHT*< M n +RIGHT*<STR$<:i\,l-<I>9^2> : I=PEEK<CIA+8> 

220 PRINT LEFT*CK*.r2>" : "MID$aO*^3. r 2> " : "RIGHT*^K*.,2> " - "RIGHT$CSTR*< I > ., 1 1 

230 GET K£: IF K*="" THEN GOTO 1.50 



TPUG magazine page 53 



C64 

PROVINCIAL 
PAYROLL 



A complete Canadian Payroll System for Small 
Business. 

• 50 Employees per disk (1541) • 
Calculate and Print Journals • Print 
Cheques • Calculate submissions 
summary for Revenue Canada • 
Accumulates data and prints T-4s • Also 
available for 4032 and 8032 Commodore 
Computers. 

Available from your Commodore Dealer. 



Distributed by: 



W 



ICROCOMPUTER 
SOLUTIONS 

1262 DON MILLS RD. STE. 4 
DON MILLS, ONTARIO M3B 2W7 
TEL: (416)447-4811 



FAMILY TREE 

A dynamic program to control your data on the 
Family Tree. Ideal for the Genealogist. Links indi- 
viduals together to produce Pedigree Charts, Family 
Group Record Forms and Indexes. Easy editing and 
sorts. 

$49.95 U.S. or $59.95 Cdn. 



PET-I-GREE 



Recordkeeping system for the Dog Breeder and 
Kennel Operator. Individual dog records, breeding 
records, show records and pedigree charts can be 
produced. Easily altered for other animals. 

$99.95 U.S. or $129.95 Cdn. 
Other software 

at discount prices. 

Write for our catalogue of over 100 Software pro- 
grams at low discount prices. 

GENEALOGY SOFTWARE 



519-344-3990 
P.O. BOX 1151 
PORT HURON, Ml 
48061 



1046 PARKWOOD AVE 
SARNIA, ONTARIO 
N7V 3T9 



COMSPEC 

866 Wilson Ave., Downsview 
633-5605 

• HARDWARE 

• SOFTWARE 

• SERVICE 

• BOOKS 

• ACCESSORIES 

^s commodore 
Off the Shelf Delivery 

THIS MONTHS SPECIALS 



WICO "BOSS" 


$19.95 


WICO "3-WAY" 


32.95 


WICO "BAT HANDLE- 


29.95 


EASY SCRIPT 


39.00 


COMMODORE VIC CARTRIDGES 


13.95 


COMMODORE C-64 CARTRIDGES 


22.95 


POWER 


59.95 


PAL 


59.95 


TOOLBOX 


109.95 


BOX OF 10 DISKS WITH THIS AD 


19.95 



10% Discount to 
TPUG Members 

ON SOFTWARE, BOOKS AND ACCESSORIES. 

(not INCLUDING sale items) 
Mail orders subject to shipping and handling fees. 

TPUG Library 
Available For Copy 

Ontario residents add 7% Retail Sales Tax. 



CO 

0) 


* 
Dufferin St. 






Wilson 


Ave. 




Hwy. 401 






MasterCard 




page 54 TPUG magazine 



C-64 THERMOSTAT 



This article describes a hardware project for those of you who are 
already past the beginner's stage in hardware building. 



John Vanderkooy 

Waterloo, ON 

These are the times to save energy and, to promote this end, my 
son and I (he's the real programmer) decided to use our C-64 
computer to act as a high-level controller for the furnace. (This 
summer we'll work on the air conditioner). The beauty of a com- 
puter is its programmability, allowing temperature variation to 
give comfort in the home with the best energy savings. For families 
with a fixed schedule, the temperature can be programmed well in 
advance, and to aid the non-programmers (who vastly outnumber 
us) an idiot-proof menu can be designed, using the keyboard. All 
the foregoing, of course, is simply an attempt to justify the exis- 
tence of our home computer!! 

The Commodore 64 (or VIC 20) lends itself very well to the above 
purpose. The temperature can be measured by using an appropri- 
ate thermistor on the game port paddle input; in fact, four tempera- 
tures could be so dealt with. It might be useful to have the outside 
as well as the inside temperature, for example, since one could 
then integrate the temperature difference to determine the num- 
ber of degree-days of heat load for the furnace. If you have a 
printer, you can print out all of that and other data to impress your 
neighbours. Think of how much money you could save if you 
printed out the temperature every few minutes, so that you'd go 
through a box of Z-fold paper every fortnight. Seriously, though, I 
feel this project is worthwhile. It will save energy, teach some 
elementary interfacing techniques and tends to bring out the best 
in programming, because the end result really matters. 

More on the method of connecting up the computer. I used a 6 
kilo-ohm nominal thermistor, mounted just below the normal 
thermostat. The unit connects via thin wires and a jack to pins 7 
and 9 of control port 1 (for safety, you might put a220-ohm resistor 
in series with the connection to pin 7, which is the +5 volt life- 
blood supply of the computer). If you make no other modifications, 
the value of POTAX found by peeking memory location 54297 will 
be very low, quite unsuitable for accurate temperature determination. 
It is desirable to have a PEEK(54297) value of about 200. That 
allows variation up to 255 (the maximum which occurs for low 
resistance; thermistor warm) and downward variations (which rep- 
resent a cooler thermistor). The C-64 and VIC 20 have 1000 pf 
timing capacitors on the game ports, so that 470 kilo-ohms repre- 
sents (nominally) a full scale reading of 255 (see C-64 Programmer's 
Reference Guide, p. 472). To use my 6k thermistor, I paralleled the 
internal capacitor with a 43 nanofarad polystyrene unit, connected 
to the same jack to pins 8 and 9 of control port 1. Figure 1 shows the 
connections to the game port. Almost any type of capacitor will do 
(except an electrolytic), but it should not be sensitive to humidity 
variations, since this would falsify the temperature reading. For 
my computer, I chose not to use an interrupt routine to read 
POTAX {C-64 Programmer's Reference Guide, p. 346), since this 
might compromise the real-time clock accuracy. Those with a C-64 
link will have to place it at $c000 for proper clock operation. The 
C-64 uses an analog switch (U28, a 4066) under control from the 
keyboard scanning CIA (Ul, a 6526). For a game, this would be a 
serious limitation, but for thermostatic control, the keyboard sees 
very occasional action, unless you make it work under interrupt 
control while you play your games! The VIC 20 doesn't have this 
problem; maybe some unused VIC 20's will end upas thermostats! 

To prevent any contention, I wired a shorting switch across the 
4066, but it doesn't really make any significant difference. In 
reading the thermistor "temperature", there is a slight variation in 



PEEK(54297), but by averaging 100 of these values this allows an 
increase in the relative accuracy with which the temperature can 
be determined. Our setup achieves a resolution better than 1/10 
Celsius degree. Calibration is easily performed by using an accu- 
rate mercury-in-glass thermometer to measure the readings at, 
say, 15 and 20 degrees Celsius, and assuming a linear interpolation. 

Now the other half of the problem; how to turn the furnace on and 
off? I contemplated this for some time and came up with a scheme 
that affords some protection from computer foibles or power failures. 
Figure 2 shows how a small 12 volt relay can be controlled from the 
user port. My relay pulls in nicely with anything over about 8 
volts, so the 9 volt ac at the user port can be rectified and smoothed 
to provide an adequate supply. The relay can be driven by a single 
NPN transistor, which has base drive from the MSB bit of the user 
port. The program can easily set this bit to output via the DDR, 
and these steps are incorporated in the program which is given 
later. The base resistors are chosen so that the relay is normally off 
even when the user port is not active as an output. Almost any NPN 
transistor will do. The diode across the relay coil prevents the 
large spike which accompanies the turnoff of an inductive relay 
coil. Connections to the 24 volt ac control system of a normal 
thermostat should not be made with very thin wire; there is a 
substantial current required to properly operate the gas valve or 
relay on an oil furnace. This summer we got a central air conditioner, 
so I had an extra thermostat at my disposal. Figure 2 also shows how 
the two thermostats are used to advantage in a heating situation. 
Thermostat A sets an upper limit temperature which cannot be 
exceeded by any computer directive, since it shunts the control 
relay R. If the house temperature lies between the two setpoint 
limits, the computer can turn the furnace on and off with the relay. 
In my setup, A is set to about 21 Celsius and B to 14 Celsius. Our 
daytime computer controlling temperature is set to 20 degrees 
Celsius, and at night or when we're away, it is near 15 degrees 
Celsius. Any lower and the plants complain of numbness. This 
deployment of the two thermostats gives safety, flexibility and a 
reasonable default situation. If only one thermostat is available, I 
would use it like B (with A shorted), since this gives protection 
against freezing when the youngsters in the house forget about the 
computer's prime directive and turn to JUMPMAN instead. Pur- 
chase of a second thermostat would be nicer and certainly much 
cheaper than a clock thermostat. Electric heating thermostats cost 
about $15.00. Before the computer control, I had used the two 
thermostats as in figure 2, with a timer switching the relay for night 

game port 1 



THERMISTOR 

(6K nominal 20° ) 



\l# 2 # 3* 4 # B # ) 
Y % 7 f 8 f *>y J 





fig. 1 



43nF 

continued overleaf 



TPUG magazine page 55 



setback, using the normally closed contacts, so that A can be set to 
the normal temperature during those times (or left there). The 
control program can readily be modified to use either relay sense 
or polarity. 

An important point concerns the operation of the temperature- 
regulating algorithm. My program models the action of a normal 
thermostat. When it switches on or off, the motion of the mercury 
blobs causes a hysteresis so that switching it again requires a 
considerable change in temperature, perhaps as much as 1 or 2 
degrees. This makes the action decisive but would create large 
temperature excursions if unchecked and result in a very low 
cycling rate, due to the large thermal inertia of the house. To 
combat this effect, a small heating coil is incorporated near the 
bimetallic temperature sensing spiral, which is activated by the 
current in the control line. This heater anticipates the rise in 
temperature and acts to decrease the cycling time. The combined 
effect of the two mechanisms produces a more constant cycling 
interval, in which the on-off duty cycle regulates the temperature. 
My programs incorporate hysteresis (about 1 degree) and antici- 
pation, the latter by allowing the hysteresis to decay exponentially 
with a time constant of around four minutes. It's really nice to have 
a computer at this point; almost any variation in the algorithm can 
be easily tried. I have been told that 6 cycles per hour is ideal for a 
gas furnace, 3 for oil; that is easily arranged. In fact, it would be 
fairly simple to make the controller have a fixed cycle rate; one 
simply establishes a repetitive triangular waveform with an equiva- 
lent amplitude of, say, 1 degree, and uses a somewhat modified 
method to create modulation of the on-off duty cycle. The regula- 
tion tolerance and cycle time are related, but at least we have a 
number of interesting control possibilities. In our programming, 
we tend to make step changes in the temperature (for example, in 
the morning), but the internal computer "set-point" could be smoothly 
altered. Who knows what marvellous dreams might be conjured 
up by a once per hour sinusoidal temperature variation during the 
night! 



The regulating program given below is liberally interspersed with 
REMarks. This short program gives just a regulating algorithm 
with no frills. A longer program is available from the author by 
sending him a self-addressed envelope with postage paid. In that 
program, the menu portion is one view of how programmability 
can be handled. BASIC is plenty fast enough for the control, and 
many embellishments are allowable. If the computer is turned off, 
or there is a power interruption, all control will be lost, of course. 
This is not serious if you have wired up two thermostats as described 
earlier. An ambitious possibility is to prepare an auto-start eprom 
at location $8000 which has a small routine to transfer the BASIC 
program (also in the eprom) to start at $0800, and enter the appro- 
priate commands into the keyboard buffer to restart the control, 
bypassing the menu. Naturally, the time will be lost, so some 
nominal set-point must be chosen, for later updating by the dis- 
gruntled homeowner. I would be happy to hear about anyone's 
experiences with software "Thermostatgraphy", but I wish to empha- 
size that anyone's ill consequences encountered are not my 
responsibility: you are on your own! 

Already I am giving thought to how I can control our air condi- 
tioner this summer, in such a way that humidity and the outside 
temperature are included in some "comfort algorithm". One could 
even include a cadmium-selenide photocell on the game port to 
incorporate action based on the solar heat input! 

The programs tend to end up with a lot of variables. I recommend 
that you try a simple regulation version first, then adorn it with 
your own personality. We have a longer version to calculate the 
duty cycle and use the whole screen to display the recent furnace 
behaviour. One could even use a graphic display. Keep the wiring 
to the thermostat and furnace reliable; the rest of the family will 
not be amused if there's trouble while you're away. Perhaps a 
simple defeat switch would be advisable. TPUG 



hi-limit 
thermostat 



10 



*-D* 



DIODES 
1N914 

-• 



12 VOLT 
RELAY 



11 



A^ 



PB0 



-/-"\. 



lOOy^F 

Z25V 



IK 



-WW- 




GND 

USER PORT 
CONNECTIONS 



510JTL 



TO 



1 








21°C 




r 








— — \ 

NO V 

XV 


,NC 




A 




NPN 




15°C 


LO-LIMIT 
THERMOSTAT 


B>,100 






B 


-S 


, 




YACJE ^ 













fig. 2 



page 56 TPUG magazine 



Learn to use the real power of your C-64 computer!! DISK FILES let you handle lots of data. 
. . . FAST. 

Whatever you have in mind . . . Mailing Lists, Recipes, Book Titles & Authors, Personnel, 
Accounts, Inventory, etc, etc, YOU NEED FILES!! 

The FILE DISK is a menu driven suite of programs that enables you to start using files at 

once. You can choose your own file names, and your own label' for each type of item you 

want to include in any file. 

FILE DISK programs are EASY TO USE . . . Routines are WRITTEN IN BASIC ... you can list 

them and see how they work. You will soon want to use these routines in your own 

programs. 

FILE DISK #1 Creates, Opens and Closes sequential files for you. It will let you write to a 
new file, or add (append) to an existing file . . . and enable you to read your files to the 
computer screen or your printer. 

FILE DISK #2 Lets you create RELATIVE files . . . FAST . . . EASY!! Almost INSTANT ACCESS 
to any record. Hundreds of records in one file— Up to 20 fields in each record — Access 
records by #or by 'key' field — Create — Write — Find — Read —Change — Delete or Print 
any record. 

— Can't remember the record number?? Use the 'KEY' field!! 
-Can't find it by KEY ??? Then SCAN the file . . . Fast Scan/Slow Scan!! 

— Set your own file size and field names. Create a data base. . . EASY. . . FRIENDLY!!! 
If you are not yet an experienced user, then don't be baffled by commands that are hard to remember . . . Don't get 
involved in 'super-software' that you don't need. . . 

GET FILE DISK #1, for SEQUENTIAL FILES, -or- GET FILE DISK #2, and USE RELATIVE FILES!! 

FILE DISK programs are Menu Driven . . . and include TUTOR (or HELP) screens to assist you. Also includes 

complete printed instructions. 

FRIENDLY SOFTWARE, 55 Ellerslie Ave, Suite #1117, Willowdale, Ontario, M2N 1X9 
Send Cheque or Money Order, or use MASTERCARD. (Include Card # & Expiry Date) 
FILE DISK #1 only $12.95 — FILE DISK #2 only $19.95 - BOTH for only $29.95 
(Ont. Residents please add 7% Sales Tax) 



DATA BASE 
FILES! 

EASY 
FAST 

MENU-DRIVEN 
GET YOURS! 
ORDER NOW! 



J 



SUPERPET OWNERS RESERVE YOUR OS-9 



V 



TPUG will implement the popular 6809 operating system 
"OS/9" on the SuperPET. OS/9 greatly expands software 
availability and the hardware capabilities of this computer 
while at the same time preserving access to the Waterloo 
languages and programs. 

The cost of OS/9 to club members will be around $ I 50 
(U.S.), which will include the cost of a hardware modifica- 
tion that will not affect the normal operation of the Super- 
PET. Two board SuperPETs require a simple hardware 
modification — we provide instructions. To reserve your 
copy please mail $68.09 to TPUG. (1912A Avenue Rd., 
Suite 1 , Toronto Ont, M5M 4A1 , Canada). In the unlikely 
event that TPUG does not proceed with OS/9, your deposit 
will be refunded. 

What does OS/9 offer? 

* A true operating system with UNIX features and the 
simplicity and command style of Commodore BASIC; 

* Multi-tasking and multi-user environment; 

* Multi-level directories similar to those available in 
MS DOS 2.O.; 

* Time and date stamp for all directory entries (files); 

* File access privileges may be restricted by the owner of 

a file. 

Extensive software is available for OS/9 most of which will 
run on the SuperPET. 



The OS/9 package includes an assembler, editor, com- 
mand (shell) library monitor, symbolic debugger 

Available Languages (compilers) include BASIC-09, Pas- 
cal, CIS-COBOL, C Language. . . and others. 

Available Application Programs: Word processors, busi- 
ness, inventory and accounting applications. 

Public Domain: Software, relational database and spread- 
sheets, extensive public domain software and documentation 

TPUG will acquire public domain software and assist users 
in the conversion of commercial software to Commodore 
format. 

Portability and Expandability 

* SuperPET OS/9 programs will run on all OS/9-based 
microcomputers. 

* OS/9 will run hard disks and parallel drives. 

* There will be source code compatibility to versions of 
OS/9 that are planned for the Motorola 68000. 

For information call TPUG Inc. (416)782-8900 

(416)782-9252 
For Technical Information 
Gerry Gold (416) 667-31 59 / 225-8760 
Avy Moise (416) 667-3954 / 667-9898 

Limited number of copies will be available. 



TPUG magazine page 5/ 



compu-simple simon 



PERIPHERALS 

Gemini 10X $378.88 

Epson RX-80 494.88 

Tymac "The Connection" 149.99 

Turbo Print Interface 99.99 

Wico Boss Joystick 18.88 

Wico Power Brip Joystick 28.88 

Wico 3 Way Deluxe 33.99 

Power Pad (Graphic Tablet) 78.88 

PRODUCTIVITY SOFTWARE 

General Ledger (Timeworks) $74.99 

Paperclip (Batteries Incl.) 84.99 

Superbase 64 99.99 

COMPUTE! Books 

Mapping the 64 $19.99 

Machine Language for Beginners 19.99 

Second Book of the 64 1 8.99 

EPYX 

Pitstop II $41.99 

Impossible Mission 36.99 

Breakdance 36.99 

World's Greatest Baseball 36.99 



BRODERBUND 

Championship Lode Runner $35.99 

. . . Hint Book for above 10.99 

Raid on Bungeling Bay 31 .99 

Castles of Dr. Creep 31 .99 

PARKER BROTHERS 

Mrs. Do's Castle $42.99 

James Bond Agent 007 54.99 

Popeye 54.99 

Star War: The Arcade Game 54.99 

Montezuma's Revenge 42.99 

OTHERS 

Archon II (Elect. Arts) $48.99 

Beyond Castle Wolfenstein 34.99 

Sorcerer (Infocom) 49.99 

INFOCOM Hint Books 10.00 ea. 

TO ORDER 

Send certified check or money order along with $3.25 to 
cover postage and handling (Quebec residents add 9% sales 
tax) to COMPU-SIMPLE SIMON, P.O. Box 583, SNOWDON, 
Montreal, H3X 3T7 



JOIN OUR SOFTWARE AND PERIPHERAL DISCOUNTCLUB AND SAVE UPTO 70% ON OUR REGULAR LOW LOW PRICES. 
COST TWENTY DOLLARS FOR TWO YEARS. OUR NEW 1985 V2.0 CATALOGUE IS NOW AVAILABLE FOR $1.00. 
REFUNDABLE ON FIRST ORDER. COMSPEC 




What is the 

ULTIMATE TEST of 

TRIVIAL KNOWLEDGE? 

6400 questions. 

3 levels of difficulty for 1-8 players. 

Count down clock and Sound & Graphics. 

6 different categories. 

For the Commodore 64 ® 
"The Game designed to Flex the Mind!" 

CXJIZARD 6400" 

^~ Send $37.95 (Can.)' 

Pedlar Discount 
84 Jarvis Street, Fort Erie, Ontario, L2A 2S6 

Terms of Payment: cheque; money order; Master Charge or VISA. 

Ontario Residents please add 7% Provincial Sales Tax. 

Commodore 64 is a trademark of Commodore Business Machines Inc. 

Dealer Inquiries Invited 



Taking Farming Into The Future 




The Farm Accountant 

- double entry bookkeeping 

Farm inventory and Filer 

- inventory control and database management combined 
in one easy to use package. 

Farm Financial Analysis 

- analyze your financial records to maximize farm profits. 

Farm Management software for Apple II or Commodore 64 
computers. 

DIGIPRC 

907 River Street East 

Prince Albert, Sask. S6V 0B3 

(306)764-1707 



page 58 TPUG magazine 



THE NEW SYS 



Robert Rockefeller 

Langton, ON 

When the software engineers at Commodore were designing the 
C-64 computer, they did not program a new BASIC language for it. 
Instead, they used BASIC 2.0, which had been written for the 
second generation of the PET computers. This version of BASIC 
contained several "bugs", most of which have been corrected on 
the C-64. 

Besides the corrections made, several improvements were made as 
well. One of the BASIC commands which was improved was the 
SYS command. It is now possible to pre-load the processor regis- 
ters from BASIC for use by a machine language routine called by 
SYS. This increases the power of SYS immensely, and especially 
gives the BASIC programmer easy access to his computer's ROM 
(read-only memory) routines. 

SYS used to work this way: first the number after SYS was con- 
verted to binary and stored as a two-byte integer on page zero, in 
location 20. This number of course is the start of your routine in 
memory. An indirect jump was then made to the location repre- 
sented by this number and the machine language program was 
executed until the RTS (return from subroutine) instruction was 
encountered, at which time control of the 6502 CPU was returned 
to the BASIC interpreter. SYS still works in this manner with this 
exception; the Accumulator, the X-Index register, the Y-Index 
register and the Status register are loaded with the contents of four 



memory locations on page three before the called machine code 
routine is executed. Also, the contents of the registers are repro- 
duced in these locations after RTS is executed in the called routine. 
The relevant memory locations are: 

$030c 780 -Storage for 6502 Accumulator 

$030d 781 —Storage for X-Index Register 

$030e 782 -Storage for Y-Index Register 

$030f 783 —Storage for Processor Status 

To illustrate the ability of the "new and improved" SYS command 
to control ROM routines I have written a short BASIC program 
which uses four of the Kernal (VIC operating system) routines to 
save any portion of memory to disk or any portion of memory 
below 32K to cassette. The four routines used are SETLFS, SETNAM, 
SAVE and CLOSE. You should have no trouble learning to use 
your ROM routines if you study the program. Of course, it is 
necessary to understand the signifigance of each routine before it 
can be used. The C-64 Programmer's Reference Guide contains a 
section explaining most of the operating system routines. This is a 
good place to start. 

To sum up then, the procedure for passing parameters to a ROM 
routine or any machine language routine is this; POKE the value 
you wish the processor registers to contain on entry to the machine 
code routine to the requisite memory locations listed above, then 
SYS to the routine. That's all there is to it. Happy SYS'ing. TPUC 



19 PRINTCHR*a47>SPC<:3V , HIT RETURN AFTER"SPCC;7 VEACH ENTRV. " 

29 A=780:X=781 :V=782 

30 REM 

40 REM SET LOGICAL.. FIRST & SECONDRRV ADDRESSES 

50 REM 

60 PRINT:PRINT"DO VOU WISH TO SAVE TO" :PRINT" CASSETTE., OR" :PRINT" DISK": INPUT DEVIC* 

70 IFLEFT.t'.':DEVIC*^i::» = ,, C"THENDEVIC=l 

80 IFLEFT*CDEVIC*^i: , ' = "D l, THEN DEVICES 

90 IFLEFT-SCDEVIC*.. 1 X'-CORLEFT^DEVIC*, 1 >>"D"THEN60 

109 PRINT:PRINT"UHAT TVPE SAVE" :PRIMT"0. RELOCATABLE" :PRINT" 1 . NON-RELOCATABLE" 

HOI NPUTSAV* : SAV= I NT < VAL < SflV* > > : I FSflV<SORSflV> 1 THEN 1 00 

120 POKEA.. 1 :P0KEX.,DE:P0KEV.,SA:SVS65466:REM SETLFS 

130 REM 

140 REM SET PROGRAM NAME 

150 REM 

160 PRINT: PR I NT "ENTER START,. END.. NAME" 

179 INPUTSR$..EN$..NA$:SR=INT<;VALc;SR$:>:> :EN=INT<: VAL<TEN*> y 

180 F0R.T=lT0LENc:NAME*>:P0KE511+.T,ASCc:MID*avlAME^^_T^l>> :NEXTJ 
190 POKER, LENC NAME* > :POKEX,0 :P0KEV,2 :SVS65469 :REM SETNAM 
200 REM 

210 REM SAVE PROGRAM 

220 REM 

230 SR-SR/256 : P0KE252 , I NT < SR > : P0KE25 1 ., < SR- 1 NT <. SR > > *25S : POKEA , 25 1 

240 EN=EN/25S:P0KEV,INT«::EN} rPOKEX.. <EN-INT<EN> >*256 : :SVS65496 :REM SAVE 

250 END 



TPUG magazine page 59 



...Games. ..Games. ..Games. ..Games. ..Games. ..Games 



Wizard 

Malcolm O'Brien 

Toronto, ON 

WIZARD For The C-64 

From: Progressive Peripherals, 2186 South Holly, 

Suite #2, Denver CO 80222 USA (303) 759-5713. 

SS9.95 

Go out and buy this game right now! This 
is my favourite! I've spent a zillion hours 
with it and still haven't seen it all! There 
are forty screens and if that's not enough, 
the WIZARD Construction Set allows you to 
create your own screens. You can put up to 
one hundred screens on a disk! And when 
that disk is full, start another! 

Now that I've expressed my exuberance, 
I'll describe the game. WIZARD is a climb- 
ing game, basically, but this can scarcely 
convey the richness of the game. There is 
such a wide range of possibilities (including 
user-created ones), you are certain to be 
enchanted. 

The magicians behind all this are named 
Steven Luedders and S.A. Moore. Both are 
High Adepts of the Ancient Mystical Order 
of Programmers and have infiltrated an 
organization called Progressive Peripher- 
als and Software which markets their arcane 
creation. 

Let me set the stage for you. You have to 
guide Wilfred the Wizard through these 
innumerable screens. You collect treasures 
and avoid the "bad guys". Most importantly, 
get the key! Once you have the key, take it 
to the keyhole. At this point, the wizard 
turns into a wisp of smoke and goes through 
the keyhole to the next level. The first 
screen is called "Playground" because noth- 
ing chases you. You can roam around at 
will and discover what you can do and 
what kind of things will happen. These are 
numerous, but I'll give you an idea. 

You can climb ropes, ladders and stairs. 
But be careful — ropes can move or disap- 
pear or become invisible; ladders do the 
same. Stairs may smooth out to become 
slides and all manner of things can be waiting 
for you at the bottom! You can jump and 
duck — and when the Phantom Archer is. 
shooting at you, you'll be glad you can 
jump and duck! You can ride the elevators 
up or down or be teleported by entering 
magic portals. And you can cast spells! 

Here's a tip: the quicker you get the key 
and go through the keyhole, the higher 
your bonus points. This is easier said than 
done and becomes increasingly difficult as 



you move up the levels. I had to play the 
level called "Rock 'n Roll" many times before 
I figured out how to stay alive, let alone 
advance to the next level. It was quite a 
while before I figured out what to do on 
"Totally Tubular" and I rarely survive 
"Great Balls of Fire". 

Whew! Sound tough? If you think so, cre- 
ate an easy version. The High Adepts have 
seen to it that you may use their enchant- 
ment as you will to create your own ethe- 
real worlds. But beware — many a wizard 
has fallen. And I do mean fallen. 

Whenever you lose a wizard he falls down 
to the bottom of the screen, complete with a 
circle of stars rotating above his head. But 
an interesting thing happens: his wizard's 
hat falls off first. It usually comes to rest on 
a higher level, but the wizard always falls 
all the way down. This is an amusing addi- 
tion to what is already superb animation. 
The sound is equally superb. It's more like 
the soundtrack from a cartoon than the 
sound effects of a computer game. 

Wilfred the Wizard is one of the most lov- 
able and charming characters I've ever seen 
in a computer game. You're certain to feel 



very sympathetic when his hat falls off and 
he tumbles down to the bottom of the screen. 
He's part of the reason why this game has a 
compelling playability. 

As if all this wasn't enough, there's more. 
Progressive Peripherals and Software intend 
to have the WIZARD Expansion Set avail- 
able in the Fall of this year. The Expansion 
Set will feature a new Construction Set pro- 
gram with expanded advanced features, 
the top twenty levels sent in from current 
users of the program (the competition will 
end Sept. 30, 1984), and twenty other all- 
new levels! 

We're talking serious gaming here! A few 
more points should be noted: one to six 
players, four difficulty levels plus Custo- 
mized and Mystery (random screens) for a 
total of six game options, ten selectable 
play speeds (including too fast!), top scores 
are saved to disk, fast-running demo and 
11 pages (8 J 2 by 11) of excellent documen- 
tation. 

There's only one thing to do. Go out and 
buy this game right now! And hold onto 
your hat! TPUG 



Trivia 



George Shirinian 

Toronto, ON 

TRIVIA. For Commodore VIC-20and64. Cym- 
bal Software. VIC 20 disk $39.95, C-64 disk S49.95. 

"Welcome to the wonderful world of TRI- 
VIA, where facts from all walks of space 
and time converge in a medley of mind- 
boggling questions." It is surprising that 
someone has not come out with a computer 
version of the game that swept the country 
last Christmas season before now. TRIVIA 
is not a direct copy of the popular board 
game but is a highly entertaining quiz pro- 
gram in its own right. 

The game contains 1600 questions in the 
C-64 version, 1000 for the VIC 20, and is 
available, in good Canadian tradition, in 
both English and French. It does not uti- 
lize the familiar game board of the "manual" 
version, and has a different logic to the 
play. When beginning a game you can select 
a "think-time" of 10, 15 or 20 seconds and a 
game length of 50, 100 or 150 points. Differ- 
ent questions have different points. There 
can be from I to 6 players. 



The questions are presented on a colourful 
screen, but there is no particular graphic 
display. There are sound effects for correct 
and incorrect answers, but, again, these are 
unremarkable. The real excitement in this 
game is to come up with the right answers 
to the questions and type them in correctly, 
while watching the seconds fly by on the 
screen's timer. 

One feature I liked is that questions are 
randomized, so that no two games play the 
same. This is essential in a program that 
will be played over and over. Secondly, I 
was quite impressed to discover the pro- 
gram gives partial points to a close answer, 
giving poor spellers or typists some en- 
couragement. The questions are drawn from 
both American and Canadian experience 
and are interesting, challenging and fair. 
Topics range from TV and movies to sports, 
history, etc. 

The first person to reach the game score 
wins. Statistics are displayed at the end of 
the game and reveal some very interesting 
facts. The person with the highest percent- 
age of correct answers does not necessarily 
win the game. The variable points for the 
questions can help a weaker player win, if 
he or she gets enough of the higher ones. 
This makes the game more exciting and 
fun all around, as everyone has a real chance 
to win. TPUG 



page 60 TPUG magazine 



3. .. Games. ..Games. ..Games. ..Games... Games. ..Game 



Creature 
Creator 



Rich Westerman 

St. Anne, IL 

CREATURE CREATOR From Designware. 

S39.95. 

System Requirements: Commodore 64, Disk 

Drive 

Classification: Education (ages 4 to 8) 

CREATURECREATOR is a "gentle" intro- 
duction to programming — but the pro- 
gram's layout and operation would lead 
you to believe that it is a game. It has hi-res 
graphics, animation and sound effects, but 
these are used to disguise a tutorial on 
elementary programming structure. 

CREATURECREATOR is all menu-driven, 
and the introductory screens and activities 
are all controlled by only two keys, making 
it easily accessible to the new computer 
user. 



Here's how it works: I'm sure you've heard 
of the "Identi-kits" used by police depart- 
ments to reconstruct faces from witnesses' 
descriptions. CREATURECREATOR is an 
identi-kit for creating monsters. Using only 
two keys, and prompted by simple ques- 
tions and commands, you can create a com- 
posite cartoon-like character. Combining 
heads, bodies, arms and legs from seven 
selections in each body area, dozens of com- 
binations are possible. When you have con- 
structed a creepy critter on the screen, you 
can then make it "dance" by commanding 
it to wave, hop, stomp, grab, turn its head 
or even roar. The DANCE portion of CREA- 
TURE CREATOR even allows you to com- 
bine a series of those commands into a 
program. 

Sooner or later, a child will press the key 
which says GAME and CREATURE CRE- 
ATOR will begin doing its intended job of 
teaching the rudiments of programming 
logic. The GAME board shows two mon- 
sters side-by-side on the screen. At the bot- 
tom of the screen is a grid of boxes. The 
monster on the left is the computer's and 



the one on the right is yours. The com- 
puter will make its monster go through a 
set of "dancing" motions and it's your job 
to give your creature the correct commands 
which will make it duplicate the motions of 
the other creature. The grid at the bottom 
of the screen records your commands and 
are easily edited should you make errors. 
Multiple difficulty levels are available in 
the GAME portion of CREATURE CRE- 
ATOR, allowing a measure of additional 
challenge. 

CREATURE CREATOR is an engaging, 
colorful and well-designed educational 
program. It is perhaps overpriced in the 
wake of new arrivals of low-priced educa- 
tional software for the Commodore 64. 

CREATURE CREATOR also suffers from 
too much copy-protection. It is sometimes 
necessary to re-load the program two or 
three times before it will run correctly, and 
the wear and tear on the drive (caused by 
this protection method) is an annoying fac- 
tor. TPUG 



Kids On Keys 



Rich Westerman 

St. Anne, IL 

KIDS ON KEYS From Spinnaker. $34.95. Disk 
For Commodore 64. Recommended for ages 

3-7. 

Perhaps the largest obstacle to overcome 
when convincing kids to move from joy- 
stick wiggling to keyboard usage is that, 
until you're familiar with the keyboard, 
you can't manipulate the computer with 
the speed and facility that you're used to 
with the joystick. It's hunt and peck — and, 
to most kids, that's just no fun. 

There is a growing body of software appear- 
ing for the C-64 which attempts to tackle 
this problem. I'm referring to the "keyboard 
familiarity" programs, and KIDS ON KEYS 
is Spinnaker's entry into this market. KIDS 
ON KEYS is nothing less than a typing 
tutor for young children. It offers the child 
three separate arcade-style games, which- 
are played using the keyboard. Game One 
requires the player to type the letter that 
slowly falls from the top of the screen. If 
the proper key is tapped before the letter 



reaches the bottom, the letter explodes and 
then appears at the top of the screen as a 
"trophy". This continues until fifteen let- 
ters have been "popped". You then get to 
play a bonus round. A child in a balloon 
slowly falls towards the bottom of the screen, 
festive music plays, the child in the balloon 
waves and the balloon again takes to the 
sky. Success in the bonus round will prompt 
the computer to ask the child if he wants to 
go to the next level of difficulty or go back 
to the main menu. 

Games Two and Three require the player 
to identify different objects on the screen 
within a time limit, the duration of which 
is determined by the difficulty level. 

It was in Games Two and Three that I 
found a serious problem in my copy of the 
software. KIDS ON KEYS contains files of 
objects that the main program loads. These 
files contain the graphic routines that cre- 
ate the objects the child has to identify. 
The authors of KIDS ON KEYS wisely real- 
ized that if the program is played often by 
the same children, the challenge of typing 
the names of the objects will disappear. 
Thus, an option to create and name new 
objects and then SAVE them to a separate 
disk was provided. The program gave me 



easy-to-understand prompts for the format- 
ting of the data disk, and the joystick-driven 
drawing routine worked fine. When I tried 
to SAVE my new file of objects to the data 
disk, however, nothing happened. Try as I 
might, I couldn't get any new files SAVEd. 

If the "MAKE PICTURES" option was never 
used in KIDS ON KEYS, the program would 
be quite impressive. The graphics are bright 
and colorful and the music and sound effects 
(while not as sophisticated as other offer- 
ings by Spinnaker) are adequate. The 
program can be run quite easily by kids of 
the recommended age group (what with all 
the prompts and excellent error-trapping, 
it seems to be crash-proof). Too bad my 
copy couldn't live up to its own manual's 
promises. TPUG 



TPUG magazine page 61 



ks.. . books... books... books.. .books...books... books. 



COMMODORE 64 COLOR GRAPHICS: A Beginner's Guide 



John Moore 

Windsor, ON 

As a Commodore Computer owner and 
user for over three years now, I've always 
been curious and fascinated by the use of 
graphics. I played around with my 'old' 
PET character set, creating little pictures 
and then making them move around the 
screen in a variety of ways, and adding 
little graphic rewards in the educational 
programs with which I dabbled. One thing 
that encouraged me to trade in the PET for 
the new Commodore 64 was its unique 
graphic capabilities. High-res pictures and 
Sprites were a real novelty for me. 

Adding colour and new twists to my old 
PET graphics has been fun, and playing 
with the Koala Pad and other high-res pack- 
ages has been a real blast. But doing high- 
res pictures on my own has seemed to be 
more difficult than I could manage. At least, 
it was, until a friend introduced me to 
COMMODORE 64 COLOR GRAPHICS: 
A Beginner's Guide. This easy-to-follow, 
step-by-step guide shows you how to create 
your own detailed pictures while provid- 
ing you with a "toolkit" of subroutines to 
accomplish this task. Ever bought a "be- 
ginners guide" that any idiot should under- 
stand, only to be blown away in the first 
chapter and left wondering how come you're 
so dumb? This will not happen with COM- 
MODORE 64 COLOR GRAPHICS: A Be- 
ginner's Guide. 

The Introduction in Chapter 1 assumes 
nothing. It starts by suggesting you turn 
your equipment "on" and tells you where 
to find the switch. It gives a few BASIC 
tips, a chart on Commodore Colors- on 
what keys to find them, and some tips about 
the program listings found in the book. It 
tells how to key them in, how to RUN them, 
SAVE and VERIFY, what to do if prob- 
lems occur, and all those things that so 
many "beginners guides" assume you al- 
ready know. So far, so good: even this 'idiot 1 
could understand! 

The next four chapters take you one small 
step at a time through the processes of turn- 
ing on the high-res screen, setting colours, 
locating and plotting points, drawing lines, 
painting shapes and everything else neces- 
sary to create a detailed picture. The book 
provides the data needed to draw the pic- 
ture that appears on the inside front page 
of the book. Every chapter also provides 
exercises that encourage the reader to experi- 
ment and create other designs and shapes. 
Every subroutine is explained in detail. It 



tells you what is happening, why it is hap- 
pening and gives additional examples of 
what each routine is used for. All this in 
plain English! 

The final chapter covers Sprites and Sprite 
movement. In the same plain English, and 
with the same attention to detail, the mys- 
teries of Sprite creation, colour and move- 
ment are explained. 

Again, several other examples are provided 
and the reader is encouraged to experi- 
ment with other designs. 

Altogether I think COMMODORE 64 
COLOR GRAPHICS: A Beginner's Guide 
does a very thorough job of explaining and 
teaching high-res graphics in a manner that 
any novice can really understand. But that's 
not the end of the story — or of the book 
either! 

The Postscript provides very good ideas 
for additional uses for the program, along 
with more Sprites, including the data to 
make them. This opens up another whole 
new area of experimentation. Appendix A 
is a programmer's trouble-shooting guide. 

It includes several preventive measures, as 
well as common cures for problems you 
might encounter. Appendix B provides a 
complete listing of all the subroutines in 
the 'toolkit'. Appendix C gives the listings 
of several additional 'tools', such as draw- 
ing and painting rectangles, polygons and 
circles, along with the usual complete expla- 
nation of what's happening and why. 

The very important and useful Appendix 
D shows how you can speed up the subrou- 
tines with the use of machine language. 
The one thing that is most disturbing about 
high-res in BASIC is that it is so slow. Appen- 
dix D begins to solve this problem by replac- 
ing six of the most common routines with 
machine language equivalents, which are 
read in from BASIC. A brief explanation is 
followed by the six program listings. The 
little extra time spent keying in these extra 
listings is more than made up by the in- 
creased speed of the drawing routines. 

The last few pages of the book include charts 
and graphs of screen locations, colour, 
Sprites and a toolkit reference guide. I'm 
sure I've more than got my $16.95 worth 
out of my tattered copy TPUG W 

COMMODORE 64 COLOR GRAPHICS: 

A Beginner's Guide 

By: Shaffer & Shaffer Applied Research & 

Development 

Publisher: The Book Company 



Defending The Galaxy ^f 

Lorien Gabel 
Toronto, ON 

Defending The Galaxy is a book that covers 
almost all areas of the video gamer's world. 
It purports to be "the first complete guide 
to the entire world of The Games". 

When you first flip through this book you 
are barraged by a number of assorted top- 
ics relating in some way to the video game 
world. Some of the topics presented are 
sections on how to tell the games apart, a 
list of different enemies that you will even- 
tually be facing, tips for survival in such 
games as Tron, Stargate, Turbo etc., and a 
chapter on the evolution of the video games. 

Included is a very interesting list of all the 
video games ever released and a short expla- 
nation about each (153 in all). There is also 
a guide to the most popular video game 
places in the U.S., state by state. Sadly, 
there is nothing in this section that includes 
Canada. 

Also included is a list of the high scores for 
the most popular games, set at that time. 
Most of these have been broken by now but 
it is still helpful in that you can gauge your 
own scores by it. 

The major deficiency (if you take Defending 
The Galaxy seriously as a guide to video 
gaming) is that it is outdated. It was released 
in late 1982 and doesn't have a thing on the 
new and very popular video disk games. 
Therefore, the hints about such games as 
Turbo, Space Invaders and Zaxxon are not 
very helpful. However, this doesn't pose a 
serious problem since much of this book 
refers to the video world in general. 

I found that the book was not very satisfy- 
ing in really teaching you anything about 
video games, but it is doubtful whether or 
not it is really trying to do so. Most of the 
book approaches video gaming from a 
humourous angle: e.g. Video Virgins, 
jamming, packing, and such aspects. Real- 
ising that his book will not teach you much 
in the way of serious gaming, the author 
has graciously added a list of books that do 
teach you how to play. 

In conclusion, Defending The Galaxy is a 
good book if you are looking for something 
that is generally informative, entertaining 
and somewhat far from the serious side of 
video gaming. If you are looking for a book 
on how to master the games, you should 
look elsewhere. TPUG 

DEFENDING THE GALAXY from Triad Pub- 
lishing Co. by Michael Rubin. $4.95 (U. S.) 



page 62 TPUG magazine 





For the Commodore 64 with 
super graphics and great 
sound effects 



Master the skill and self-control needed to play winning 
blackjack. Learn the most effective yet the simplest 
"card counting" system, which is used by the world's 
most successful international blackjack players. You can 
simulate the rules of the best casinos around the world 
where you ought to be playing and winning. Play one 
hand against the dealer and leam the basic strategy 
using the "card count" system, or play up to seven 
hands and see how well you can play under real casino 
conditions. 

Included is a separate 38K program that will let you play 
blackjack with up to seven different players. 

While you are playing one hand, the computer works out 
the card count, your % chance of going bust, each card's 
chance of being drawn, the basic strategy, keeps track of all 
your bets and prints a running summary of your game. 

Comes complete with the book 

Beat The Dealer by Edward O. Thorpe. 

Dealer Enquiries Welcome. 



VIC-20 SOFTWARE 



BOOKS 



JOYSTICKS 



Krazy Kong 


$14.95 


Exterminator 


$14.95 


Miner 2049er(K) 


$44.95 


Lode Runner(K) 


$49.95 


IFR (Flight Simulator) (K) 


$49.95 


MD001 Snakman 


$19.95 


CS013 Astroblitz(K) 


$49.95 


CS016 Apple Panic(K) 


$49.95 


CS017Choplifter(K) 


$49.95 


CS018 Black Hole(K) 


$49.95 


ORM004 Crossfire 


$29.95 


HESC307Shamus(K) 


$49.95 


Introduction to Basic I 


$49.95 


Introduction to Basic II 


$49.95 


Frantic 


$19.95 


Wacky Waiters 


$19.95 



* Requires 3K exp. (K) cartridge 



COMMODORE 64 SOFTWARE 



Simon's BASIC $99.95 

Impossible Mission $49.95 

1541 Disk Aligner $29.95 

International Soccer $49.95 

World's Greatest Baseball $49.95 

Musicalcl $52.95 

Triad (disk and tape) $19.95 

Quazar (disk and tape) $1 9.95 

Sysres64 $79.95 

Superbase 64 (Database) $129.95 

Power 64 $69.95 

Pal 64 $69.95 

Blue Max (disk) $42.95 
Grand Master Chess (disk and tape) $39.95 

Fort Apocalypse (disk) $42.95 

Survivor (disk) $42.95 

Jumpman (disk) $49.95 

Jumpman Junior (cart.) $54.95 

Shamus(disk) $42.95 

Lode Runner (disk) $49.95 

Personality Analyzer (disk) $29.95 



Mapping the VIC $19.95 

Anatomy of the 1 541 $24.95 

Anatomy of the Commodore 64 $24.95 

Commodore 64 Exposed $19.95 

Sprite Graphics for C-64 $20.95 

Machine Language for Beginners $20.95 

64 Sound and Graphics $18.95 

PET Basic $19.95 

VIC 20 Prog. Reference Guide $19.95 

Elementary Commodore 64 $18.95 

C64 Prog. Reference Guide $27.95 

VIC Revealed $18.95 

VIC Graphics $18.95 

VIC Games $18.95 

Compute's 2nd book of PET/CBM $19.95 



COMPUTER SUPPLIES 



C1 Cassette Tapes $ 1 .00 ea. 

C20 Cassette Tapes $ 1 .25 ea. 

Cassette Boxes .25 ea. 

Verbatim Disks M0525-01 $39.90/10 

Memorex Disks 013481 $33.90/10 

Nashua Disks SS/DD $29.90/10 

K10 Disk Storage Box $5.95 

Flip Sort Storage Box $39.95 



PET/CBM SOFTWARE 



POWER 

8040-80 col. 4.0 sys 

4040 — 40 col. 4.0 sys 



$119.95 



WICO Bathandle 
WICO Power Grip 
WICO Track Ball 
WICO Red Ball 
Commodore Joystick 



$34.95 
$34.95 
$69.95 
$37.95 
$9.95 



* All Joysticks will fit VIC 20 or Commodore 64 computers 



RIBBONS 



8023 $14.95 

1525 $12.95 

MX-80, 4022 $12.95 

1526,4023 $14.95 

Spirit 80 $14.95 

2022 $ 4.95 

Tally MT160 $19.95 

Ribbons for other makes available. 



ORDERING INFORMATION 

Cheque, Money Order, VISA, Master Card accepted. 
Ontario residents add 7% sales tax. Add 5% for shipping 
(minimum charge $2.00). 

NOTE: All Prices In Canadian Funds. 



■'! !■■! iCB&i 



ELcCROniO 2001 LTD. 

5529 Yonge Street, Willowdale, Ontario M2N 5S3 
Tel: (416) 223-8400 



TPUG magazine page 63 



product parade. ..product parade. ..product pa 




This is the third issue of TPUG Magazine which includes Product 
Parade — our regular feature presenting new, as well as not so new, 
software and hardware available on the market. As we depend on 
the information sent to TPUG by manufacturers and distributors, 
it is not always possible to strike the right balance between software 
and hardware products described in the feature. This month's 
Product Parade, for example, includes mostly software products. 
But we do have a lot of interesting new product announcements, 
both hardware and software, for the November issue. This is to 
inspire you with some Christmas gift ideas. Remember, however, 
that Product Parade, does not review products, but simply provides 
information. 




***************************** 



Memory expander for the Commodore 64 from LETCO 

LETCO (Leader Electronic Technology Company), the pioneer of 
the popular 64K memory expander for the VIC 20, has developed 
a 64K byte memory expander for the C-64. It plugs directly into the 
C-64 expansion port and provides eight separate 8K blocks of 
paged memory. Each page is selected by a single POKE instruction. 
Those users who already have the 64K memory expander for the 
VIC 20 need to purchase the adapter only to use their 64K memory 
expander on the Commodore 64. 

The adapter (Model 64KVA) is priced at $29.95 U.S. The memory 
(Model 64KV) for use on the VIC 20, is priced at $109.95 U.S. The 
combination (Model 64KC) for use on the C-64, is priced at $139.95 
U.S. All products are available directly from Leader Electronic 
Technology Company LETCO, 7310 Wells Rd., Plain City, OH 
43064. 



Xref HELPER from (M)agreeable software, inc. 

Xref HELPER prints a cross-reference listing to help the user find 
where a particular value came from in his Commodore 64 BASIC 
program. 

Xref HELPER scans the program on diskette for all occurances of 
variables, constants, GOTOs, and GOSUBs. As it scans it inserts 
each name, and the number of the line on which it occurred, into a 
list. Xref HELPER orders this list alphabetically or numerically 
within each group. It also orders the variables by type; for example, 
integer or string. When Xref HELPER has completed the scan of 
the program, it sends the ordered list to the printer. 
Written in KMMM Pascal, Xref HELPER scans small programs in 
a few seconds, medium programs in one to five minutes, and large 
program in five to ten minutes. 

Xref HELPER is available from (M (agreeable software, inc., 5925 
Magnolia Drive Plymouth MN 55442, (612) 559-1108 for $25.00 
U.S. plus $1.25 U.S. shipping. Canadian residents may pay $32.40 
Cdn. plus $1.60 Cdn shipping. 



ZOOM Pascal 64 from Abacus Software 

ZOOM Pascal 64 for C-64 owners offers the programming conve- 
nience of structured high-level language. Data types include float- 
ing point reals, integers, strings and scalars. The ZOOM Pascal 64 
allows also accessing conventional text files whether on disk or 
tape. 

The ZOOM Pascal 64 package consists of: 

* EDITOR — to create, save and modify Pascal source language 
statements 

* COMPILER — to translate the Pascal source language statements 
into intermediate code 

* TRANSLATOR — to translate the intermediate code into actual 
6502 machine language 

* Comprehensive user's manual 

* Sample programs to show how to get the most from ZOOM Pascal 
64. 

ZOOM Pascal 64 comes on diskette only for $39.95 U.S. Available 
from the local dealer or directly from ABACUS Software, P.O. 
Box 7211, Grand Rapids, MI 49510, (616) 241-5510 



TINY FORTH from Abacus Software 

TINY FORTH is a high-level language to run on Commodore 64 
or VIC 20 (with 8K expander). TINY FORTH comes with well over 
200 words in its vocabulary. But it is extensible — the user can add 
his own words to this built-in vocabulary. TINY FORTH includes 
also a full-screen editor for creating new "screens' 1 that can be 
saved to disk or tape. 

The 45-page manual which comes with the TINY FORTH intro- 
duces the user to the FORTH language. 

The price for TINY FORTH on cassette (for both C-64 and VIC 
20)is $19.95 U.S. The version on diskette (for both C-64 and VIC 20) 
costs $22.95 U.S. Available from the local dealer or directly from 
ABACUS Software, P.O. Box 7211 Grand Rapids, MI 49510, 
(616)241-5510 



page 64 TPUG magazine 



ict parade. ..product parade.. .product parade.. 



Graphics Designer 64 from Abacus Software 

Graphics Designer 64 for Commodore 64 allows designing hi-res or 
lo-res graphics. It can be used for architectural design, engineer- 
ing graphics, graphic arts, artistic expression, and more. 
The Graphics Designer 64 Editor lets the user interactively create 
his picture. The Editor is completely menu driven. No program- 
ming is necessary. The user can edit a picture from the keyboard or 
with joystick or a suitable light pen. Finished pictures can be saved 
to diskette. The Slide Show feature makes it possible to combine 
ready pictures for later display. The user can also obtain hardcopy 
of his hi-res screen on the following printers: VC-1515, 1525E, 
Epson or Gemini printer. 

Graphics Designer 64 (on diskette only) costs $34.95 U.S. Available 
from the local dealer or directly from ABACUS Software, P.O. 
Box 7211 Grand Rapids, MI 49510, (616) 241-5510 



DISKOVERY distributed by Micron Distributing 

DISKOVERY programs promote learning through exciting and 
challenging game formats. 

DISKOVERY has four programs available for children aged 3 to 
8 — Alphabet Factory and Match-up (reading ski lis programs); and 
Adding Machine and Take Away Zoo (mathematical skills programs). 
For children aged 6 to 12, The Word Bird and Time Zone are 
helpful in developing vocabulary, word order, sentence meaning 
and reading skills. 

All of the programs are available for the Commodore 64 and retail 
for $29.95. Look for the DISKOVERY educational programs at 
local computer stores or contact Micron Distributing, 409 Queen 
Street West, Toronto ON M5V 2A5 (416) 593-9862 (Toll Free Order 
Desk 1 (800) 268-9052). 






GRAPH-TERM 64 from Bennett Software Company 

GRAPH-TERM 64 for the Commodore 64 is a graphics terminal 
emulator program which prints text and high-resolution plots 
generated by a mainframe computer. It is thus of particular inter- 
est to scientists and engineers who use standard graphics programs 
generating plot files in Tektronix format. 

Because it is written totally in machine language, GRAPH-TERM 
64 not only can display high-resolution graphs as they are transmitted 
but can download the plot files and replay them up to 20 times 
faster. It can also produce hard copies of the plots on the Commo- 
dore 1520 plotter. 

GRAPH-TERM 64 comes with a number of simple BASIC pro- 
grams for saving and loading plot files and for illustrating the use 
of machine language subroutines in it. 
In summary, GRAPH-TERM allows the user to: 

* view Tektronix format plots generated by a mainframe computer 

* download text or plot files 

* generate plot files on the Commodore 64 

* preview plots on the high resolution screen 

* create hard copies of the plots on the Commodore 1520 Plotter. 

GRAPH-TERM 64 may be ordered from Bennett Software Company, 
3465 Yellowstone Drive, Ann Arbor, Michigan 48105. The price is 
$49.95 + 4.00 shipping and handling (U.S. funds). 



SPELL NOW from Access Software Incorporated 

SPELL NOW an educational program for the C-64 by Todd Witzel, 
is designed to help children improve their spelling ability. The 
program, endorsed by educators, allows children to improve the 
spelling words that are giving them the most trouble. Up to fifty 
words can be entered onto a spelling list. 

Kids choose from three game options: "See It, Spell It", "Quiz Me" 
and "Hangman". Each game is uniquely designed to make spelling 
an enjoyable task. 

SPELL NOW is available from Access Software, 925 East 900 South 
Salt Lake City, Utah 84105 for the price of $34.95 U.S. 



Melodian Keyboard, Melodian Concert Master, Melodian MelodyMaster 
and Melodian RhythmMaster from Melodian Inc. 

Melodian Inc. introduced a musical keyboard for the Commodore 
64 and three software packages to teach reading and performing 
music. 

The 37-key, 3-octave keyboard is similar in appearance to a porta- 
ble electric organ. It operates by plugging into a Commodore 64, 
using the microcomputer's synthesizer to reproduce 16 instrumen- 
tal sounds. 

The Melodian ConcertMaster, Melodian MelodyMaster and Melodian 
RhythmMaster feature entertaining and educational software which 
can be used either with the Melodian keyboard or separately. 
The Melodian ConcertMaster combines the capabilities of a music 
synthesizer, recording studio and video display. Anyone can play 
the Melodian ConcertMaster immediately. No previous knowledge 
of music is necessary. 

The Melodian MelodyMaster teaches music and pitch. After making 
a selections from a set of prerecorded or computer generated 
music, the player tries to reproduce the melody, note for note. As 
each note is played, it is displayed on the screen in color, indicating 
whether it is right or wrong. The computer shows the mistakes, 
guiding the user's performance until every note is correct. 

The Melodian RhythmMaster is similar in concept to the Melodian 
MelodyMaster. It helps to develop perfect timing through the use of 
color coded video displayed notes. 

The Melodian keyboard with the Melodian ConcertMaster retails for 
$200.00 U.S. The price for the Melodian software disks is $39.95 
U.S. each. 

For the nearest dealer contact: Melodian Inc., 115 Broadway —Suite 
1202, New York, NY 10006, (212) 406-5163. 



******** 



TPUG magazine page 65 



*** mfiRKCTPLRGE. 



This space 

could be 
advertising 

YOUR 
product 


CLEAROUT SPECIALS 

For C-64 

QBopper $15.00 

For VIC 20 

Krazy Kong $9.95 
Galactic Blitz $9.95 
Sidewinder $9.95 
3-D Man $9.95 

Electronics 2001 

5529 Yonge St., Willowdale, ON 
M2N5S3 (416) 223-8400 


For a good time. . . 

call the 

cJjradley £/*Jrolners 

cJuullelin cJjoard Qjysiem 

c/o David and Richard Bradley, 
147 Roe Avenue, 
Toronto, Ont., 
M5M 2H8 

Only $10.00 per year. 
(All cheques should be payable to David 
Messages Bradley) Programs 
(416)487-5833 (416)481-9047 
(416)481-8661 (416)272-0709 


Star Trek Version II is now available. 
Over thirty new features and improve- 
ments with more machine code and 
colour graphics. 

Send $4.00 to join mailing list and news- 
letter. Version III is now under way and 
will only be available to members. 

Write: 

Ufland Software 

c/o Dave Neale 

Box 1324, Meaford, 

ON NOH 1Y0 (519) 538 1758 


* COMAL * 

programming manual 

by 
BORGE CHRISTENSEN 

see page 11 
M for details . . . >^ 





Advertiser s Index 

Page 

Academy Software 21 

Batteries Included OBC 

Beacon Software Inc 52 

Besco Products 39,43 

Bradley Brothers Bulletin Board System 66 

B & R Enterprises Inc 34,38,43 

Canadian Software Source 44 

Cardinal Software 48 

Comal Handbook (TPUG) 11 

Comal Users Group U.S.A., Limited 34 

Comspec Communications Inc 13,54 

Compu-Simple Simon 58 

Copp Clark Pitman Ltd 25 

Digipac 58 

Electronics 2001 63,66 

ENG Manufacturing 34 

Excel Typewriters Ltd 44 

Fidelity Electronics 6 

Friendly Software 57 

Genealogy Software 54 

G.R.Q 12 

Handic 68 

Hunter Nichols Inc IBC 

King Microware 6,32 

Kyan Software 44 

Mannesiuann Tally 67 

Micol Systems 29 

Micro Systems Development 17 



Microcomputer Solutions 54 

Milne's Computer Control Systems 18 

Nova Computer Systems 40 

OS/9 (TPUG) 57 

Precision Software 2 

Programmer Guild Products Ltd 18 

Progressive Peripherals and Software 49 

Pro-Line Software IFC 

Salt and Pepper 58 

Silicom Software Inc 30 

Software Lab 30,30 

Thunderware Software 43 

TPUG Membership 10 

Transactor 16 

Ufland Software 66 

Watcom Products 21 

Watcom Seminars 23 

Wycor Business Systems 34 

* classified * 



This space is limited to TPUG member wanted or for sale 

items only. 

Space cost is 25 cents per word. NO DEALER ADS ACCEPTED 



FOR SALE: 8032, 4040, 4022P, Wordpro, Waterloo Basic, 
manuals, monitor and utility ROMS. $2200.00 (519) 886-0155. 



A UTILE SPIRIT 

CAN GIVE YOU 

EXTRAORDINARY 

PRINTING POWER 



1 




SIX 

Jniomths 

J8BS* 

Spirit's the microprinter that lets you do more things 
yourself. And do each of them letter perfect. 
It prints standard, bold, expanded and condensed type 
faces. Even italics. And finely etched graphics. All because 
t jh a <^^ ^^" every impression has a crisp, square edge to it for unmistakable 

m ^~J^m That's the power to look perfect in print. 

And a power that operates almost without sound. The 
Quietpak option smothers printer noise. So Spirit rushes through work with barely a whisper. 

There's also the power to manage paper. Variable width tractors adjust for narrow jobs like 
labels. Or wider jobs like correspondence. All of which are handed to you immediately thanks to 
Spirit's Quick Tear edge. 

When you can have your own personal microprinter 
that does so much for so little, aren't you powerless not 



to act? 

For more information, and a dealer in your area 
contact: Mannesman Tally Corporation, 703 Petrolia Rd., 
Downsview, Ontario M3J 2N6 416-661-9783 
Telex: 06 522 873 

* Manufacturer's suggested retail price with parallel interface. 



MANNESMANN 
TALLY 



"THERE'S NO NEED TO HOLD A 
MOUSE OR LAY A FINGER ON A CRT 
SCREEN. SAY THE COMMAND AND 



HOW TO ORDER 



CHIRPEEWILL DO THE REST." 

Chicago Tribune 
June 6, 1984 



To order your Chirpee Computer Voice Command Module, 
simply fill our form below and return with cashier's check, 
money order or use your credit card. Please specify type of 
computer. Postage paid by manufacturer on shipments from 
destinations within the continental U.S. Full 90-day parts and 
labor factory warranty. Allow two weeks for delivery. 



Now anyone can use a 
computer! Now 
everyone will 
use their 
computer 



more! 




Chirpee is a trademark of ENG Manufacturing, Inc. 



ORDER NOW! 
MONEY BACK GUARANTEE! 



ENG Manufacturing, Inc. 
4304 W. Saturn Way 
Chandler, AZ 85224 
(602) 431-0400 
(In U.S.) 1-800-431-3331 



_Chirpee(s) Computer Name. 



ORDER FORM 

Yes, I would like to order 

Command Voice Module(s) at $179.95 each for the following 
computer(s): 

□ Commodore 64 (01-101) □ Atari (01-102) 

□ Apple(01-103) D IBM PC (01-104) 

□ I have enclosed a Cashier's Check or Money Order in the 
amount of $ 

D Mastercard DVisa □ American Express D Diner's Card 

NO. EXP. DATE 

SIGNATURE 




-State Zip_ 



ENG Manufacturing, Inc. 
4304 W. Saturn Way 
Chandler, AZ 85224 
(602) 431-0400 
(In U.S.) 1-800-431-3331 



INTRODUCING— 




*M 



r PAL 64 ^ 

The Fastest and easiest to use f 
K^ assembler for the Commodore 64. 
Pal 64 enables the user to perform 
assembly language programming using the 
standard MOS mnemonics. $69,95 

yLPOWER 64 

y j Is an absolutely indispensible aid to 
^*m the programmer using Commodore 
64 BASIC, Power 64 turbo -charges 
resident BASIC with dozens of new super 
useful commands like MERGE. UNDO. 
TEST and DISK as well as all the old 
standby* such as RENUM and SEARCH & 
REPLACE. Includes MorePower 64. $69.95 

A/TOOL BOX 64 

, V N C Is the ultimate programmer's utility 
fr* package, Includes Pal 64 assembler 
and Power 64 BASIC soup-up kit all 
together in one fully integrated and 
economical package, $129.95 




A-rSPELLPRO 64 

j Msan easy to use spelling checker 
/^^ with a standard dictionary expandable 
to 25.000 words. SpellPro 64 quickly 
adapts itseif to your personal vocabulary 
and business jargon allowing you to add and 
delete words to/ from the dictionary, edit 
documents to correct unrecognized words 
and output lists of unrecognized words to 
printer or screen. SpellPro 64 was designed 
to work with the WordPro Series *and 
other wordprocessing programs using the 
WordPro file format. $69.95 

NOW SHIPPING!!! 

For Your Nearest Dealer 

Call 

(416) 273-6350 

t Commodore 64 and Commodore are trademarks of 
Commodore Bwinca Machines Inc. 
* Presently marketed by Professional Software Inc 



Specifications subject lo change without notice 



A— WPM 

y f This brand new offering from th_ 
/^A o r ig inators of t he Word Pro S e r ies ' 
brmgs professional wordprocessing to the 
Commodore 64 for the first time. Two 
years under development, WP64 features 

100% proportional printing capability as 
well as 40/80 column display, automatic 
word wrap, two column printing* alternate 
paging for headers & footers, four way 
scrolling, extra text area and a brand new 
'OOPS* buffer that magically brings back 
text deleted in error. All you ever dreamed 
of »n a word processor program, WP64 
sets a new high standard for the software 
industry to meet. $69,95 

A-,MAILPR0 64 

^ 7 A new generation of data 
^^A organizer and list manager* MatfPro 
64 is the easiest of all to learn and use. 
Handles up to 4 .000 records on one disk, 
prints multiple labels across, does minor 
text editing ie: setting up invoices. Best of 
all, MailPro 64 resides entirely within 
memory so you don't have to constantly 
juggte disks like you must with other data 
base managers for the Commodore 64. 

$69.95 




PROLINE 

■MHIII80FTWARE 

(416)273-6350 

7SS Th* QUEENSWAY EAST. UNIT 8. 
MISSISSAUGA. ONTARIO. CANADA. L4Y ACS 



INTERNATIONAL CENTRE, TORONTO 
NOVEMBER 29 & 30, DECEMBER 1 & 2 , 1984 



■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■a 



iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 

IIIIIIIIIIIimilGIIIIIIHIIIIIIIIIBIIlll 

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■I 

■ ■■•■■■■■■»■ ■■■■■■■■■■■■■■■(■■■■■■■■■BIABB 
IIIIIIIIIIIIIIIHIIIIIIIIIIII 

Illllllllllllllflllllllllllllllllll 

■ ■I lllllllllllllllll ■ ■■■ ■ 

■ ■■■■■■■■■■■■I !■■■■■■■■■■■■■■■■■■■■■■■■■■ 
»■*■■■■■■■■■■■*■■*■■■■■»*■■■•* «■■■■■■■■ 



■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■a 

■■■■»■■■■■■■■■■■■■■■■■■■■■■■■■■ VMH ■■■■■■ 
■■■»■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ ■■■■■«■* 
■■■■■■■■■■■(■■■■■■■■■■■•■■■■(■■■A ■■■■■■■■ 
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■»■«■■ 

■ ■■»■•■■■■■■■■««■■■■»■■«■ IIBI11I «■■■■■■« 
■■■■■■■■■■■■■•■■■■■■■■■■■■■■■■■■■■■■■■■■■ 

■ ■■■■*■■»■■■■■■■■■■■■■■■••■■!■*■■■■■■■■■ 
■■■■■■■■■■■■■■I ■ ■■■■■■■■■BVIfl »■■■■■■■■■■ 

■ iniiiiiiaii 

lllllllllllllllllllllllllllllllllllllllll 

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■a 

flllll«ltK ■■■■■II1IIIBIHII 

■■■linifliiiiiiiniwiiiiiiiiiiii ill 

■■■■■■■■■■■■■■■■■■■■lllllllllllllllllllll 

HilliiiitiiiiiiiiBia iiiiiiflinii 

iimiimimiiiiiiiiiil 

liliiiiiveiiiHiimi miBiiiiiailii 

■ ■■■II Illlllll -BBBBHBI 

lllliiiiiiiiiafisi^ mill 

■■■■Illllllllllllllllllllllllllllllllllll 



■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■»»»■■■■ 

^ ■■•■■■■■■! ^■■■■■■■■■•■■■■■■■■■■■■IIIIBIIB ^^_^_ 

^^V^H ■ ■■■■■■■■*■■■■■■■■■■■■■■■■■■■■■«■■■■■■»■ ^H^^ 

The world oF 
commodore 



^ TT 

* he Company that had the 

foresight and imagination 

-M- to desien and build more 



he Company that had the 
foresight and imagination 
to design and build more 
computers for home, business and educa- 
tion than any other will be presenting 
the most farsighted and imaginative show 
to date with exhibitors from around 
the World. 

The 1983 Canadian World of Commodore 
Show was the largest and best attended 
show in Commodore International's 



history. Larger than any other 
Commodore show in the World 
and this year's show will be 
even larger- 
World of Commodore II is designed 
specifically to appeal to the interests 
and needs of present and potential 
Commodore owners. 

Come and explore the World of 
Commodore. 




world of- „ 

commodore n 



A HUNTER NICHOLS PRESENTATION, 
FOR MORE INFORMATION CALL (4l6) 439-4140